11 lines
284 B
Go
11 lines
284 B
Go
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
|
|
} |