aboutsummaryrefslogtreecommitdiff
path: root/go/utils
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2022-12-27 14:29:39 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:46:38 +0200
commitd6b5eeaa5e639c5ab89b5e1c93075a1b765794dc (patch)
treef87422bb91c2197f88aa8d29092592858764049d /go/utils
parent3c2ee4ee48480a28dc606878503f314ec8862d45 (diff)
downloadmuhqs-game-d6b5eeaa5e639c5ab89b5e1c93075a1b765794dc.tar.gz
muhqs-game-d6b5eeaa5e639c5ab89b5e1c93075a1b765794dc.zip
intermediate commit
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
+}