Maps / Get map size (number of map entries) / Essential Go
package main
import "fmt"
func main() {
m := map[string]int{}
size := len(m)
fmt.Printf("Size of empty map: %d\n\n", size)
m["foo"] = 1
size = len(m)
fmt.Printf("Size of map: %d\n\n", size)
}INFO