Logo

Programming-Idioms

History of Idiom 8 > diff from v26 to v27

Edit summary for version 27 by :
[Go] More concise Demo

Version 26

2016-04-13, 19:35:20

Version 27

2016-04-14, 08:22:31

Idiom #8 Initialize a new map (associative array)

Declare a new map object x, and provide some (key, value) pairs as initial content.

Idiom #8 Initialize a new map (associative array)

Declare a new map object x, and provide some (key, value) pairs as initial content.

Code
x := map[string]int { "one": 1, "two":2 }
Code
x := map[string]int { "one": 1, "two":2 }
Demo URL
http://play.golang.org/p/4L07fOc0Sh
Demo URL
http://play.golang.org/p/P9yxcWDubV