21
0
Fork 0
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
1 changed files with 4 additions and 0 deletions

View File

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