Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(817)

Delta Between Two Patch Sets: doc/progs/go1.go

Issue 5454044: code review 5454044: doc/go1: map deletion (Closed)
Left Patch Set: diff -r 006614d062ad https://go.googlecode.com/hg/ Created 13 years, 3 months ago
Right Patch Set: diff -r a2107270ac4a https://go.googlecode.com/hg/ Created 13 years, 3 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « doc/go1.tmpl ('k') | doc/progs/run » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
gri 2011/12/08 00:07:31 2011
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // This file contains examples to embed in the Go 1 release notes document. 5 // This file contains examples to embed in the Go 1 release notes document.
6 6
7 package main 7 package main
8 8
9 import "log" 9 import "log"
10 10
11 func main() { 11 func main() {
12 mapDelete() 12 mapDelete()
13 } 13 }
14 14
15 func mapDelete() { 15 func mapDelete() {
16 m := map[string]int{"7": 7, "23": 23} 16 m := map[string]int{"7": 7, "23": 23}
17 k := "7" 17 k := "7"
18 delete(m, k) 18 delete(m, k)
19 if m["7"] != 0 || m["23"] != 23 { 19 if m["7"] != 0 || m["23"] != 23 {
20 log.Fatal("mapDelete:", m) 20 log.Fatal("mapDelete:", m)
21 } 21 }
22 } 22 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b