From 301543616b5376585a7caff097499421acdf1806 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Thu, 21 Nov 2024 14:09:58 +0100 Subject: [feature] Add domain permission drafts and excludes (#3547) * [feature] Add domain permission drafts and excludes * fix typescript complaining * lint * make filenames more consistent * test own domain excluded --- internal/util/ptr.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'internal/util/ptr.go') diff --git a/internal/util/ptr.go b/internal/util/ptr.go index 8a89666c4..d0e835c9e 100644 --- a/internal/util/ptr.go +++ b/internal/util/ptr.go @@ -17,6 +17,8 @@ package util +import "unsafe" + // EqualPtrs returns whether the values contained within two comparable ptr types are equal. func EqualPtrs[T comparable](t1, t2 *T) bool { switch { @@ -59,3 +61,8 @@ func PtrOrValue[T any](t *T, value T) T { } return value } + +func IsNil(i interface{}) bool { + type eface struct{ _, data unsafe.Pointer } + return (*eface)(unsafe.Pointer(&i)).data == nil +} -- cgit v1.2.3