Quick actions

cmd+k|ctrl+k

Navigation

Languages

Maps / Iterate a map with range / Essential Go

Snippet info

Language

Go

Visibility

public

Author

kkowalczyk

Created

2019-03-26T09:40:10Z

Updated

2019-03-26T09:40:10Z

package main

import "fmt"

func main() {
	people := map[string]int{
		"john": 30,
		"jane": 29,
		"mark": 11,
	}

	for key := range people {
		fmt.Printf("key: %s\n", key)
	}
}
INFO