From: Keith Randall Date: Sat, 24 May 2014 00:39:58 +0000 (-0700) Subject: doc: mention that reflect.SetMapIndex no longer panics X-Git-Tag: go1.3rc1~48 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4b3019b17ce8fcf0b9fab916897aaee9b24ce7fc;p=gostls13.git 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 --- diff --git a/doc/go1.3.html b/doc/go1.3.html index d98cdf629f..9a9f9f8d46 100644 --- a/doc/go1.3.html +++ b/doc/go1.3.html @@ -509,6 +509,12 @@ In particular, it only calls LookPath +
  • +The SetMapIndex +function in the reflect package +no longer panics when deleting from a nil map. +
  • +
  • If the main goroutine calls runtime.Goexit 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) {