tags:

views:

389

answers:

1

Is there a way to get a list of all the keys in a go language map? The number of elements is given by len(), but if I have a map like:

m := map[string] string = { "key1":"val1", "key2":"val2" };

how do I iterate over all the keys?

+5  A: 
for k, _ := range m { ... }
Jonathan Feinberg