✌ Go provides another important data type map that maps unique keys to values. A key is an object that you use to retrieve a value at a later date. Given a key and a value, you can store the value in a Map object. After the value is stored, you can retrieve it by using its key. A Go map type looks like this: map[KeyType]ValueType Declaration and initialization: 1) m := make(map[string]int) 2) m := map[string]int{} 3) var m map[string]int{} Map to get key of value : 1). i := m["route"] 2). i, ok := m["route"] 3). for key, value := range m { fmt.Println("Key:", key, "Value:", value) } The built-in len function returns on the number of items in a map: n := len(m) The built-in delete function removes an entry from the map: delete(m, "rouzte") GO Program : package main import ( "fmt" ) func main() { ...
it's always a good idea to keep track of your learning.