aboutsummaryrefslogtreecommitdiff
path: root/go/utils
diff options
context:
space:
mode:
Diffstat (limited to 'go/utils')
-rw-r--r--go/utils/slices.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/go/utils/slices.go b/go/utils/slices.go
new file mode 100644
index 00000000..d2bc04c1
--- /dev/null
+++ b/go/utils/slices.go
@@ -0,0 +1,9 @@
+package utils
+
+func TypedSliceToInterfaceSlice[T any](s []T) []interface{} {
+ is := make([]interface{}, 0, len(s))
+ for _, t := range s {
+ is = append(is, t)
+ }
+ return is
+}