diff options
| author | Keith Randall <khr@golang.org> | 2014-05-23 17:39:58 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2014-05-23 17:39:58 -0700 |
| commit | 4b3019b17ce8fcf0b9fab916897aaee9b24ce7fc (patch) | |
| tree | e529459e2ceebe48b7482ab93d854e65e30bf5c1 /src/pkg | |
| parent | 05cc78d8d32f6af6fc4373e10da0b4a12f0a1ad4 (diff) | |
| download | go-4b3019b17ce8fcf0b9fab916897aaee9b24ce7fc.tar.xz | |
doc: mention that reflect.SetMapIndex no longer panics
when deleting from a nil map. See issue 8051.
LGTM=r
R=golang-codereviews, r, khr
CC=golang-codereviews
https://golang.org/cl/96540051
Diffstat (limited to 'src/pkg')
| -rw-r--r-- | src/pkg/reflect/value.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pkg/reflect/value.go b/src/pkg/reflect/value.go index 2cbda3983c..576cbc3984 100644 --- a/src/pkg/reflect/value.go +++ b/src/pkg/reflect/value.go @@ -1620,6 +1620,7 @@ func (v Value) SetCap(n int) { // SetMapIndex sets the value associated with key in the map v to val. // It panics if v's Kind is not Map. // If val is the zero Value, SetMapIndex deletes the key from the map. +// Otherwise if v holds a nil map, SetMapIndex will panic. // As in Go, key's value must be assignable to the map's key type, // and val's value must be assignable to the map's value type. func (v Value) SetMapIndex(key, val Value) { |
