The Secret Life of Go: Maps
The Secret Life of Go: Maps # go # coding # programming # softwaredevelopment Chapter 5: Keys, Values, and the Art of Looking Things Up Friday morning arrived with clear skies. Ethan descended to the archive carrying the usual coffee tray and a small paper bag. Eleanor looked up from her desk. "What did you bring today?" "Black and white cookies. I figured we've covered enough territory this week to deserve them." She smiled and took one. "The optimist's cookie—never commit to just one flavor. Appropriate for today's topic." "Which is?" "Maps. Or as other languages call them: dictionaries, hash tables, associative arrays. The data structure for when you need to look things up." Eleanor opened her laptop and typed: package main import "fmt" func main () { var ages map [ string ] int fmt . Println ( ages ) } She ran it: map[] "This declares a map. map[string]int means: a map where the k...