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
This commit is contained in:
Keith Randall 2014-05-23 17:39:58 -07:00
parent 05cc78d8d3
commit 4b3019b17c
2 changed files with 7 additions and 0 deletions

View File

@ -509,6 +509,12 @@ In particular, it only calls <a href="/pkg/os/exec/#LookPath"><code>LookPath</co
when the binary's file name contains no path separators.
</li>
<li>
The <a href="/pkg/reflect/#Value.SetMapIndex"><code>SetMapIndex</code></a>
function in the <a href="/pkg/reflect/"><code>reflect</code></a> package
no longer panics when deleting from a <code>nil</code> map.
</li>
<li>
If the main goroutine calls
<a href="/pkg/runtime/#Goexit"><code>runtime.Goexit</code></a>

View File

@ -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) {