优化IsNil判断

This commit is contained in:
2024-08-13 16:30:16 +08:00
parent 3533617196
commit da44ae07ab
2 changed files with 8 additions and 2 deletions

5
any.go
View File

@ -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 获取类型