Quick actions

cmd+k|ctrl+k

Navigation

Languages

map size

Snippet info

Language

Go

Visibility

public

Author

kkowalczyk

Created

2019-08-24T15:36:46Z

Updated

2019-08-24T15:36:46Z

// :glot
package main

import "fmt"

func main() {
    // :show start
    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)
    // :show end
}
INFO