From a0d52fc093ab8ceada8f5596046808927c000849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Sat, 10 May 2025 20:39:12 +0800 Subject: [PATCH] update data type --- exception.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exception.go b/exception.go index 48d1230..4d70339 100644 --- a/exception.go +++ b/exception.go @@ -93,7 +93,7 @@ func NewWithCodeAndData(code any, data map[string]any) IException { // Author : go_developer@163.com<白茶清欢> // // Date : 21:28 2022/6/25 -func New(code any, data map[string]any, defaultMessage ...string) IException { +func New(code any, data any, defaultMessage ...string) IException { if nil == data { // 保证数据结构的一致性, 同时避免后续使用出现空指针 data = map[string]any{} @@ -164,6 +164,6 @@ func IsSuccess(e *Exception) bool { // Author : go_developer@163.com<白茶清欢> // // Date : 22:35 2022/6/25 -func NewSuccess(data map[string]any) IException { +func NewSuccess(data any) IException { return New(defaultSuccessCode, data, "") }