diff --git a/intra/core/closer.go b/intra/core/closer.go index e226a749..6d8b512c 100644 --- a/intra/core/closer.go +++ b/intra/core/closer.go @@ -209,3 +209,11 @@ func TypeEq(a, b any) bool { } return reflect.TypeOf(a) == reflect.TypeOf(b) } + +func IsZero(x any) bool { + if IsNil(x) { + return true + } + v := reflect.ValueOf(x) + return v.IsZero() // panics if x == nil +}