]> Cypherpunks repositories - gostls13.git/commitdiff
doc: mention that reflect.SetMapIndex no longer panics
authorKeith Randall <khr@golang.org>
Sat, 24 May 2014 00:39:58 +0000 (17:39 -0700)
committerKeith Randall <khr@golang.org>
Sat, 24 May 2014 00:39:58 +0000 (17:39 -0700)
when deleting from a nil map.  See issue 8051.

LGTM=r
R=golang-codereviews, r, khr
CC=golang-codereviews
https://golang.org/cl/96540051

doc/go1.3.html
src/pkg/reflect/value.go

index d98cdf629fdaaff3eecd52030784433cb2580f1d..9a9f9f8d4673228e30c3a7eaea9a3dca97bf4e6b 100644 (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>
index 2cbda3983cdf5587a0d7dae6c41d3be5d8cbdc11..576cbc3984c82bb782d9f2771a217394a27d8c66 100644 (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) {