From cf3447e89e3343e1c9531f9141e24a1383897e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20D=C3=B6ll?= Date: Tue, 30 Jul 2024 21:01:56 +0000 Subject: [PATCH] feat: add value helper --- cast/ptr.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cast/ptr.go b/cast/ptr.go index d7a73a4..9b7c018 100644 --- a/cast/ptr.go +++ b/cast/ptr.go @@ -4,3 +4,8 @@ package cast func Ptr[T any](val T) *T { return &val } + +// Value returns the value of the pointer. +func Value[T any](val *T) T { + return *val +}