in a second place: use reflect.Ptr not reflect.Pointer since the latter was added in Go 1.18

This commit is contained in:
Alex Flint 2022-10-29 15:23:56 -04:00
parent 763072452f
commit 3489ea5b2e
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ func isExported(field string) bool {
// isZero returns true if v contains the zero value for its type // isZero returns true if v contains the zero value for its type
func isZero(v reflect.Value) bool { func isZero(v reflect.Value) bool {
t := v.Type() t := v.Type()
if t.Kind() == reflect.Pointer || t.Kind() == reflect.Slice || t.Kind() == reflect.Map || t.Kind() == reflect.Chan || t.Kind() == reflect.Interface { if t.Kind() == reflect.Ptr || t.Kind() == reflect.Slice || t.Kind() == reflect.Map || t.Kind() == reflect.Chan || t.Kind() == reflect.Interface {
return v.IsNil() return v.IsNil()
} }
if !t.Comparable() { if !t.Comparable() {