From 21a87ffccae9950580a240180fd3703768ef450e Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 1 Feb 2023 18:46:32 +0100 Subject: intermediate commit --- go/utils/slices.go | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 go/utils/slices.go (limited to 'go/utils') 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 +} -- cgit v1.2.3