Commit a9a49fe9 authored by Robert Griesemer's avatar Robert Griesemer

spec: calling delete on a nil map is a no-op

This is language change. It is a backward-compatible
change but for code that relies on a run-time panic
when calling delete on a nil map (unlikely).

Fixes #4253.

R=rsc, r, iant, ken, bradfitz, rogpeppe
CC=golang-dev
https://golang.org/cl/6909060
parent f85b94aa
......@@ -5104,9 +5104,8 @@ delete(m, k) // remove element m[k] from map m
</pre>
<p>
If the element <code>m[k]</code> does not exist, <code>delete</code> is
a no-op. Calling <code>delete</code> with a nil map causes a
<a href="#Run_time_panics">run-time panic</a>.
If the map <code>m</code> is <code>nil</code> or the element <code>m[k]</code>
does not exist, <code>delete</code> is a no-op.
</p>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment