Skip to content

Instantly share code, notes, and snippets.

@xvbnm48
Created March 5, 2022 15:17
Show Gist options
  • Save xvbnm48/70a5c3eec46e024b54964ee1c363b21d to your computer and use it in GitHub Desktop.
Save xvbnm48/70a5c3eec46e024b54964ee1c363b21d to your computer and use it in GitHub Desktop.
map in go
package main
import "fmt"
func main(){
var idol map[string]string
idol = make(map[string]string)
idol["name"] = "sakura"
idol["age"] = "20"
idol["address"] = "jepang"
fmt.Println(idol)
idolgrub := map[string]string{
"JKT48": "jakarta",
"AKIHABARA": "AKB48",
"HAKATA": "HKT48",
"NAMBA": "NMB48",
}
for key, val := range idolgrub {
fmt.Println(key, " \t:", val)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment