mirror of
https://github.com/golang/go
synced 2024-11-05 18:36:08 +00:00
go spec clarification: arrays must be addressable to be sliceable
R=rsc CC=golang-dev, r https://golang.org/cl/2141041
This commit is contained in:
parent
b05679cdd6
commit
c423e95da6
1 changed files with 3 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
<!-- title The Go Programming Language Specification -->
|
||||
<!-- subtitle Version of Sep 1, 2010 -->
|
||||
<!-- subtitle Version of Sep 2, 2010 -->
|
||||
|
||||
<!--
|
||||
TODO
|
||||
|
@ -2464,8 +2464,8 @@ for slices, the upper bound is the capacity rather than the length.
|
|||
<p>
|
||||
If the sliced operand is a string or slice, the result of the slice operation
|
||||
is a string or slice of the same type.
|
||||
If the sliced operand is an array, the result of the slice operation is a slice
|
||||
with the same element type as the array.
|
||||
If the sliced operand is an array, it must be <a href="#Address_operators">addressable</a>
|
||||
and the result of the slice operation is a slice with the same element type as the array.
|
||||
</p>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue