Logo

Programming-Idioms

History of Idiom 8 > diff from v38 to v39

Edit summary for version 39 by .:
[Go] Consistent spacing.

Version 38

2017-03-20, 06:42:48

Version 39

2017-03-20, 06:43:28

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.

Extra Keywords
table dictionary hash
Extra Keywords
table dictionary hash
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/P9yxcWDubV
Demo URL
http://play.golang.org/p/P9yxcWDubV