mirror of
https://github.com/golang/go
synced 2024-11-26 16:46:58 -07:00
doc/go1.2.html: fix 3-index slice example
A number was wrong; adjust as suggested to make things clearer. Fixes #6452 R=golang-dev, minux.ma CC=golang-dev https://golang.org/cl/13422046
This commit is contained in:
parent
c2b7fb3902
commit
4977f9f926
@ -99,12 +99,12 @@ source slice or array, adjusted for the origin. For instance,
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
slice = array[2:4:6]
|
||||
slice = array[2:4:7]
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
sets the slice to have the same length as in the earlier example but its capacity is now only 4 elements (6-2).
|
||||
It is impossible to use this new slice value to access the last two elements of the original array.
|
||||
sets the slice to have the same length as in the earlier example but its capacity is now only 5 elements (7-2).
|
||||
It is impossible to use this new slice value to access the last three elements of the original array.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
Loading…
Reference in New Issue
Block a user