The syntax for map literals: m := map[string]int{"a":1, "b":2}
2. Operation of map
Add/Modify m["a"] = 2
delete delete function delete(m, "a")
get a := m["a"]
If a lookup fails, it will return the zero value corresponding to the value type. For example, the following code will work even if "bob" does not exist in the map, because ages["bob"] will return 0 on failure
The address operation cannot be performed on the map element
You can use the range function to traverse the map for name, age := range ages {}
The subscript syntax of map returns two values, the second is a bool, which is used to report whether the element exists, for example: if age, ok := m["age"]; !ok{....}