{"id":327,"date":"2019-10-20T08:32:13","date_gmt":"2019-10-20T08:32:13","guid":{"rendered":"https:\/\/golangbyexamples.com\/?p=327"},"modified":"2019-11-12T19:22:55","modified_gmt":"2019-11-12T19:22:55","slug":"different-ways-iterating-over-map-go","status":"publish","type":"post","link":"https:\/\/golangbyexamples.com\/different-ways-iterating-over-map-go\/","title":{"rendered":"Different ways of iterating over a map in Go (Golang)"},"content":{"rendered":"\n

Range operator can be used to iterate over a map in Go<\/p>\n\n\n\n

Let’s define a map first<\/p>\n\n\n\n

sample := map[string]string{\n        \"a\": \"x\",\n        \"b\": \"y\",\n}<\/code><\/pre>\n\n\n\n