From 0431cfff7828dded71b73d951cf3659cea0e3e2f Mon Sep 17 00:00:00 2001 From: Levente Batuska Date: Sun, 13 Oct 2024 21:38:37 +0200 Subject: [PATCH] refactor: add Ptr function for easy inline pointer creation --- typeutils/utils.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/typeutils/utils.go b/typeutils/utils.go index 88afe07..6cc0fcb 100644 --- a/typeutils/utils.go +++ b/typeutils/utils.go @@ -38,3 +38,7 @@ func ResultWrapb[T any](err error, val T) Result[T] { } return Err[T](err) } + +func Ptr[T any](v T) *T { + return &v +}