This commit is contained in:
Mark McGranaghan 2012-10-10 21:59:24 -07:00
parent 6a0ef1145c
commit 38378a9e10
3 changed files with 5 additions and 5 deletions

View File

@ -14,9 +14,9 @@ func main() {
var a [5]int
fmt.Println("emp:", a)
// We can set a value at a given index using the
// `array[index] = value` syntax, and get a value
// with `array[index]`.
// We can set a value at an index using the
// `array[index] = value` syntax, and get a value with
// `array[index]`.
a[4] = 100
fmt.Println("set:", a)
fmt.Println("get:", a[4])

View File

@ -9,4 +9,4 @@ 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 code. We'll look at slices next.
# typical Go. We'll look at slices next.

View File

@ -1,5 +1,5 @@
// _Slices_ are a key data type in Go, giving a more
// powerful interface to sequences that arrays.
// powerful interface to sequences than arrays.
package main