diff --git a/any.go b/any.go index d28e834..5454fa7 100644 --- a/any.go +++ b/any.go @@ -43,7 +43,10 @@ type AnyType struct { // // Date : 18:21 2023/6/1 func (at *AnyType) IsNil() bool { - return at.data == nil + if at.data == nil { + return true + } + return reflect.ValueOf(at.data).IsNil() } // Type 获取类型 diff --git a/object.go b/object.go index 197296d..f7b3972 100644 --- a/object.go +++ b/object.go @@ -71,7 +71,10 @@ func (ot *ObjectType) IsValid() bool { // // Date : 18:50 2023/6/1 func (ot *ObjectType) IsNil() bool { - return ot.source == nil + if ot.source == nil { + return true + } + return reflect.ValueOf(ot.source).IsNil() } // ToString 转字符串