13 lines
296 B
Bash
13 lines
296 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
|
|
len: 5
|
|
dcl: [1 2 3 4 5]
|
|
2d: [[0 1 2] [1 2 3]]
|
|
|
|
# You'll see _slices_ much more often than arrays in
|
|
# typical Go. We'll look at slices next.
|