If I have a map m is there a better way of getting a slice of the values v then
package main import ( \"fmt\" ) func main() { m := make(map[int]string
Unfortunately, no. There is no builtin way to do this.
As a side note, you can omit the capacity argument in your slice creation:
v := make([]string, len(m))
The capacity is implied to be the same as the length here.