diff options
author | Russ Cox <rsc@golang.org> | 2009-03-23 18:32:37 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-03-23 18:32:37 -0700 |
commit | 86145611b0ad8c6ef6923f65f8a4fd39f07f69d7 (patch) | |
tree | 0082f9d1b1e6adb4db63f2430cd84f8f82cd4ff6 /test/map.go | |
parent | 8d44052b6dd9e27a5230f66239681cec601d3a8e (diff) | |
download | go-86145611b0ad8c6ef6923f65f8a4fd39f07f69d7.tar.gz go-86145611b0ad8c6ef6923f65f8a4fd39f07f69d7.zip |
allow range on nil maps
R=ken
OCL=26663
CL=26663
Diffstat (limited to 'test/map.go')
-rw-r--r-- | test/map.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/map.go b/test/map.go index 085502bf52..95da48c75d 100644 --- a/test/map.go +++ b/test/map.go @@ -487,4 +487,10 @@ func main() { fmt.Printf("update mipM[%d][%d] = %i\n", i, i, mipM[i][i]); } } + + // test range on nil map + var mnil map[string] int; + for x, y := range mnil { + panic("range mnil"); + } } |