foo:=make(map[string]int)foo["bar"]=42// To delete an item from a map, you can usedelete(foo,"bar")value,exists:=foo["baz"]// If the key "baz" does not exist,// value: 0; exists: false
Note that slices and maps are exceptions to the above-mentioned rule. When we pass a slice or a map as arguments into a function, they are treated as pointer types even though there is no explicit * in the type. This means that if we pass a slice or map into a function and modify its underlying data, the changes will be reflected on the original slice or map.