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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…