Mark McGranaghan c852c887d7 publish arrays
2012-10-10 21:53:47 -07:00

13 lines
301 B
Bash

# Note that arrays appear in the form `[v1 v2 v3 ...]`
# when printed with `fmt.Println`.
$ go run arrays.go
emp: [0 0 0 0 0]
set: [0 0 0 0 100]
get: 100
dcl: [1 2 3 4 4]
len: 5
2d: [[0 1 2] [1 2 3]]
# You'll see _slices_ much more often than arrays in
# typical Go code. We'll look at slices next.