aboutsummaryrefslogtreecommitdiff
path: root/content/go-slices-usage-and-internals.article
diff options
context:
space:
mode:
authorAndrew Gerrand <adg@golang.org>2013-07-29 18:53:45 +1000
committerAndrew Gerrand <adg@golang.org>2013-07-29 18:53:45 +1000
commit1bb145fa097bcead2910315e51a18d47e309cb68 (patch)
treeda6058823e1e70e931030167c55579240357d05a /content/go-slices-usage-and-internals.article
parent62242208b0fb03f19e424063bef3d0ee53055f51 (diff)
go.blog: clarfiy wording of nth array element
This is the analog to https://golang.org/cl/11892043/ R=r https://golang.org/cl/12017043
Diffstat (limited to 'content/go-slices-usage-and-internals.article')
-rw-r--r--content/go-slices-usage-and-internals.article2
1 files changed, 1 insertions, 1 deletions
diff --git a/content/go-slices-usage-and-internals.article b/content/go-slices-usage-and-internals.article
index 3561220..d4a50fd 100644
--- a/content/go-slices-usage-and-internals.article
+++ b/content/go-slices-usage-and-internals.article
@@ -12,7 +12,7 @@ Go's slice type provides a convenient and efficient means of working with sequen
The slice type is an abstraction built on top of Go's array type, and so to understand slices we must first understand arrays.
-An array type definition specifies a length and an element type. For example, the type `[4]int` represents an array of four integers. An array's size is fixed; its length is part of its type (`[4]int` and `[5]int` are distinct, incompatible types). Arrays can be indexed in the usual way, so the expression `s[n]` accesses the nth element:
+An array type definition specifies a length and an element type. For example, the type `[4]int` represents an array of four integers. An array's size is fixed; its length is part of its type (`[4]int` and `[5]int` are distinct, incompatible types). Arrays can be indexed in the usual way, so the expression `s[n]` accesses the nth element, starting from zero.
var a [4]int
a[0] = 1