aboutsummaryrefslogtreecommitdiff
path: root/utils/ptr.go
diff options
context:
space:
mode:
Diffstat (limited to 'utils/ptr.go')
-rw-r--r--utils/ptr.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils/ptr.go b/utils/ptr.go
new file mode 100644
index 0000000..449f499
--- /dev/null
+++ b/utils/ptr.go
@@ -0,0 +1,6 @@
+package utils
+
+// Ptr получение указателя от произвольного значения, например, ToPtr(true) -> *bool(true)
+func Ptr[T any](t T) *T {
+ return &t
+}