1
0
mirror of https://github.com/golang/go synced 2024-11-18 15:44:41 -07:00

reflect: document that Value.Slice panics on an unaddressable array.

Fixes #4736.

R=rsc
CC=golang-dev
https://golang.org/cl/7239045
This commit is contained in:
Robert Daniel Kortschak 2013-02-01 10:02:23 -08:00 committed by Russ Cox
parent 2ccd4e9f87
commit 11d16dc535

View File

@ -1448,7 +1448,7 @@ func (v Value) SetString(x string) {
}
// Slice returns a slice of v.
// It panics if v's Kind is not Array, Slice, or String.
// It panics if v's Kind is not Array, Slice or String, or if v is an unaddressable array.
func (v Value) Slice(beg, end int) Value {
var (
cap int