]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: document that Value.Slice panics on an unaddressable array.
authorRobert Daniel Kortschak <dan.kortschak@adelaide.edu.au>
Fri, 1 Feb 2013 18:02:23 +0000 (10:02 -0800)
committerRuss Cox <rsc@golang.org>
Fri, 1 Feb 2013 18:02:23 +0000 (10:02 -0800)
Fixes #4736.

R=rsc
CC=golang-dev
https://golang.org/cl/7239045

src/pkg/reflect/value.go

index 10a4c0775b45558f0077ff24305dfe0528f99f9d..2e2c807ea08e4d9ec7dacc462f7df218404fcc3b 100644 (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