From 83e935df8a0e42c59c404ce6768daf8318c897e7 Mon Sep 17 00:00:00 2001 From: mStar Date: Sun, 7 Jul 2024 16:00:08 +0200 Subject: [PATCH] Add func to get the pointer to some value --- other/other.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/other/other.go b/other/other.go index 98e940e..0c0b37e 100644 --- a/other/other.go +++ b/other/other.go @@ -13,3 +13,7 @@ func Must[T any](val T, err error) T { } return val } + +func IntoPointer[T any](val T) *T { + return &val +}