mirror of
https://github.com/golang/go
synced 2024-11-21 19:14:44 -07:00
redo poor example of slices.
R=rsc OCL=25614 CL=25614
This commit is contained in:
parent
da38974c88
commit
da34bea950
@ -1014,11 +1014,13 @@ make([]T, length, capacity)
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
produces the same slice as allocating an array and slicing it:
|
||||
produces the same slice as allocating an array and slicing it, so these two examples
|
||||
produce the same slice:
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
make([]T, capacity)[0 : length]
|
||||
make([]int, 50, 100)
|
||||
new([100]int)[0:50]
|
||||
</pre>
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user