Skip to content

Commit 11d16dc

Browse files
kortschakrsc
authored andcommitted
reflect: document that Value.Slice panics on an unaddressable array.
Fixes #4736. R=rsc CC=golang-dev https://golang.org/cl/7239045
1 parent 2ccd4e9 commit 11d16dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pkg/reflect/value.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ func (v Value) SetString(x string) {
14481448
}
14491449

14501450
// Slice returns a slice of v.
1451-
// It panics if v's Kind is not Array, Slice, or String.
1451+
// It panics if v's Kind is not Array, Slice or String, or if v is an unaddressable array.
14521452
func (v Value) Slice(beg, end int) Value {
14531453
var (
14541454
cap int

0 commit comments

Comments
 (0)