aboutsummaryrefslogtreecommitdiff
path: root/misc/misc.go
diff options
context:
space:
mode:
Diffstat (limited to 'misc/misc.go')
-rw-r--r--misc/misc.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/misc/misc.go b/misc/misc.go
index 572651f..95fa405 100644
--- a/misc/misc.go
+++ b/misc/misc.go
@@ -6,6 +6,13 @@ import (
"strings"
)
+// Pointerize_first returns the address of its first argument, and the value of
+// its second argument. This is useful to for taking the address of a function
+// that also has an error return value.
+func Pointerize_first[T1 any, T2 any](x1 T1, x2 T2) (*T1, T2) {
+ return &x1, x2
+}
+
// Copy_map the map src to dst without clearing existing items in dst.
func Copy_map[K comparable, V any](dst map[K]V, src map[K]V) {
for k, v := range src {