Here is an example of variable:
names := []interface{}{"first", "second"}
How can it be initialized dynamically, from an array of strings?
Here is an example of variable:
names := []interface{}{"first", "second"}
How can it be initialized dynamically, from an array of strings?
strs := []string{"first", "second"}
names := make([]interface{}, len(strs))
for i, s := range strs {
names[i] = s
}
Would be the simplest