This commit is contained in:
Mark McGranaghan 2012-10-10 12:37:57 -07:00
parent d75280c111
commit 0e16b3c8a6
3 changed files with 6 additions and 3 deletions

View File

@ -8,7 +8,7 @@ Hello World
# Switch
# Arrays
# Slices
# Maps
Maps
# Range
# Functions
# Multiple Return Values

View File

@ -1,11 +1,12 @@
// Maps are Go's built-in associative data type (sometimes
// called "hashes" or "dicts" in other languages).
// Maps are Go's built-in [associative data type](http://en.wikipedia.org/wiki/Associative_array)
// (sometimes called _hashes_ or _dicts_ in other languages).
package main
import "fmt"
func main() {
// To create an empty map, use the builtin `make`:
// `make(map[key-type]val-type)`.
m := make(map[string]int)

View File

@ -1,3 +1,5 @@
# Note that maps appear in the form `map[k:v k:v]` when
# printed with `fmt.Println`.
$ go run maps.go
map: map[k1:7 k2:13]
v1: 7