yvbolt/util_types.go

11 lines
284 B
Go
Raw Normal View History

package main
// box_interface creates a slice where all elements of the input slice are boxed
// in an interface{} type.
func box_interface[T any](input []T) []interface{} {
ret := make([]interface{}, 0, len(input))
for _, v := range input {
ret = append(ret, v)
}
return ret
}