Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Empty Map with make

  • map
package main

import "fmt"

func main() {
	grades := make(map[string]int)
	fmt.Printf("%T\n", grades)

	grades["Mary"] = 99
	grades["Jane"] = 88
	grades["Bob"] = 93

	fmt.Println(grades)
}
map[string]int
map[Bob:93 Jane:88 Mary:99]