package main
import "fmt"
func main() {
items := make([]map[int]int, 5)
for i := range items {
items[i] = make(map[int]int, 1)
items[i][i] = 2
}
fmt.Printf(" Value of items: %v
", items)
items2 := make([]map[int]int, 5)
for _, item := range items2 {
item = make(map[int]int, 1)//只是获得拷贝
item[1] = 2
}
fmt.Printf(" Value of items: %v
", items2)
}