This commit is contained in:
Mike Schwörer 2023-01-15 02:27:08 +01:00
parent e25912758e
commit cfbc20367d
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF

View File

@ -34,3 +34,7 @@ func IsNil(i interface{}) bool {
} }
return false return false
} }
func PtrEquals[T comparable](v1 *T, v2 *T) bool {
return (v1 == nil && v2 == nil) || (v1 != nil && v2 != nil && *v1 == *v2)
}