From: Robert Griesemer Date: Wed, 12 Dec 2012 21:08:35 +0000 (-0800) Subject: spec: calling delete on a nil map is a no-op X-Git-Tag: go1.1rc2~1647 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a9a49fe9625194395d9eb791de7c2674d7b6f8d8;p=gostls13.git 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 --- diff --git a/doc/go_spec.html b/doc/go_spec.html index 468fb3ad28..9e8aafa999 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -5104,9 +5104,8 @@ delete(m, k) // remove element m[k] from map m

-If the element m[k] does not exist, delete is -a no-op. Calling delete with a nil map causes a -run-time panic. +If the map m is nil or the element m[k] +does not exist, delete is a no-op.