Only check for nil on pointer values on non package types
This commit is contained in:
parent
7414b7fad2
commit
1c63584463
3
item.go
3
item.go
|
@ -145,7 +145,8 @@ func IsNil(it Item) bool {
|
|||
} else {
|
||||
// NOTE(marius): we're not dealing with a type that we know about, so we use slow reflection
|
||||
// as we still care about the result
|
||||
isNil = reflect.ValueOf(it).IsNil()
|
||||
v := reflect.ValueOf(it)
|
||||
isNil = v.Kind() != reflect.Pointer || v.IsNil()
|
||||
}
|
||||
return isNil
|
||||
}
|
||||
|
|
Reference in a new issue