Maps / Maps with slices as values / Essential Go

Run Settings
LanguageGo
Language Version
Run Command
package main import ( "fmt" ) func main() { m := make(map[string][]int) fmt.Printf("Non-existing key returns zero value of []int, i.e. nil: %#v\n", m["key1"]) m["key1"] = append(m["key1"], 8) m["key1"] = append(m["key1"], 3) fmt.Printf("\nAfter appending to slice: %#v\n", m["key1"]) delete(m, "key1") fmt.Printf("\ndelete() sets back to nil slice: %#v\n", m["key1"]) }
Editor Settings
Theme
Key bindings
Full width
Lines