From a9a49fe9625194395d9eb791de7c2674d7b6f8d8 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 12 Dec 2012 13:08:35 -0800 Subject: [PATCH] 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 --- doc/go_spec.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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.

-- 2.48.1