Golang -Karte mit Kartenkarten
package main
import (
"fmt"
)
func main() {
//Create a Map with array of map
mapArraysMap := map[string][]map[string]string{
"kiran": {{"id": "1"}, {"name": "kiran"}},
"john": {{"id": "2"}, {"name": "kiran"}},
}
fmt.Println(mapArraysMap)
fmt.Println("Original length: ", len(mapArraysMap))
//Adding an Array of Map values to map
mapArraysMap["frank"] = []map[string]string{{"id": "2"}, {"name": "kiran"}}
fmt.Println(mapArraysMap)
fmt.Println("length: ", len(mapArraysMap))
//Delete entry from Map
delete(mapArraysMap, "frank")
fmt.Println("length: ", len(mapArraysMap))
}
Tired Termite