Created
April 23, 2014 16:51
-
-
Save rdp/11223234 to your computer and use it in GitHub Desktop.
demo of iterating over "just the keys" in a golang map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
m := map[string]string{ "key1":"val1", "key2":"val2" }; | |
for k := range m { | |
fmt.Println("key is:" + k) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
output is
key is:key1
key is:key2