map of slices



examples/map-of-slices/map_of_slices.go
package main

import (
    "fmt"
)

func main() {
    joeGrades := []int{2, 3, 4}
    fmt.Println(joeGrades)
    janeGrades := []int{7, 9, 5, 10}
    fmt.Println(janeGrades)

    people := make(map[string][]int)
    fmt.Println(people)
    people["joe"] = joeGrades
    people["jane"] = janeGrades
    fmt.Println(people)
}

examples/map-of-slices/map_of_slices.out
[2 3 4]
[7 9 5 10]
map[]
map[jane:[7 9 5 10] joe:[2 3 4]]

add entry delete(map, name) delete entry