isle/go/toolkit/toolkit.go

13 lines
314 B
Go

// Package toolkit contains useful utilities which are not specific to any
// specific part of isle.
package toolkit
import "reflect"
// IsZero returns true if the value is equal to its zero value according to
// reflect.DeepEqual.
func IsZero[T any](v T) bool {
var zero T
return reflect.DeepEqual(v, zero)
}