asciigoat's core library https://asciigoat.org/core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

15 lines
258 B

package reflective
import "reflect"
// IsZero tells if a value is zero either via
// v.IsZero() or reflection.
func IsZero(iv any) bool {
if p, ok := iv.(interface {
IsZero() bool
}); ok {
return p.IsZero()
}
return reflect.ValueOf(iv).IsZero()
}