(https://groups.google.com/forum/#!topic/golang-nuts/yTxmAjoc_vw) I learned
that one has to convert it to an []interface{} first. Then I was reading
the FAQ, specifically http://golang.org/doc/faq#convert_slice_of_interface,
which presents:
t := []int{1, 2, 3, 4}
s := make([]interface{}, len(t))
for i, v := range t {
s[i] = v
}
Which made we wonder. Why not just have a built in function for this, akin
it len(), that can handle it for any type. e.g. perhaps call if `face`:
fruits = ["apples", "oranges", "pears"]
fmt.Printf("%s %s %s", face(fruits))
That would at least help mitigate some the generics issues.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.