g...@golang.org
unread,Dec 10, 2012, 1:23:32 PM12/10/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to r...@golang.org, r...@golang.org, ia...@golang.org, k...@golang.org, golan...@googlegroups.com, re...@codereview-hr.appspotmail.com
Reviewers: rsc, r, iant, ken2,
Message:
Hello rsc, r, iant, ken2 (cc:
golan...@googlegroups.com),
I'd like you to review this change to
https://code.google.com/p/go
Description:
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 issue 4253.
Please review this at
https://codereview.appspot.com/6909060/
Affected files:
M doc/go_spec.html
Index: doc/go_spec.html
===================================================================
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -1,6 +1,6 @@
<!--{
"Title": "The Go Programming Language Specification",
- "Subtitle": "Version of December 6, 2012",
+ "Subtitle": "Version of December 10, 2012",
"Path": "/ref/spec"
}-->
@@ -5096,9 +5096,8 @@
</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>