mirror of
https://github.com/golang/go
synced 2024-11-14 17:30:29 -07:00
10
Change-Id: I49f14328841cc2e950e244f4cd98c4dcea1f0987
This commit is contained in:
parent
0b672df57e
commit
57030f26b0
@ -1192,7 +1192,9 @@ func typeFields(t reflect.Type) structFields {
|
||||
field.isZero = func(v reflect.Value) bool {
|
||||
// Avoid panics calling IsZero on a nil interface or
|
||||
// non-nil interface with nil pointer.
|
||||
return v.IsNil() || (v.Elem().Kind() == reflect.Pointer && v.Elem().IsNil()) || v.Interface().(isZeroer).IsZero()
|
||||
return v.IsNil() ||
|
||||
(v.Elem().Kind() == reflect.Pointer && v.Elem().IsNil()) ||
|
||||
v.Interface().(isZeroer).IsZero()
|
||||
}
|
||||
case t.Kind() == reflect.Pointer && t.Implements(isZeroerType):
|
||||
field.isZero = func(v reflect.Value) bool {
|
||||
|
Loading…
Reference in New Issue
Block a user