修复anyType IsNil判断的BUG
This commit is contained in:
10
any.go
10
any.go
@ -46,7 +46,15 @@ func (at *AnyType) IsNil() bool {
|
||||
if at.data == nil {
|
||||
return true
|
||||
}
|
||||
return reflect.ValueOf(at.data).IsNil()
|
||||
reflectValue := reflect.ValueOf(at.data)
|
||||
switch reflectValue.Kind() {
|
||||
case reflect.Chan, reflect.Func, reflect.Map,
|
||||
reflect.Pointer, reflect.UnsafePointer,
|
||||
reflect.Interface, reflect.Slice:
|
||||
return reflectValue.IsNil()
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Type 获取类型
|
||||
|
Reference in New Issue
Block a user