5. Effective Go
Like Slices, Maps Hold References
Map Literals
var timeZone = map[string]int{
"UTC": 0*60*60,
"EST": -5*60*60,
"CST": -6*60*60,
"MST": -7*60*60,
"PST": -8*60*60,
}Missing Keys
attended := map[string]bool{
"Ann": true,
"Joe": true,
// ...
}
if attended[person] { // will be false if person is not in the map
fmt.Println(person, "was at the meeting")
}