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

Side by Side Diff: test/fixedbugs/bug196.go

Issue 4290059: code review 4290059: test: enable tests using v, ok := <-ch syntax (Closed)
Patch Set: diff -r ebebe9ba6c35 https://go.googlecode.com/hg/ Created 13 years, 12 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:
View unified diff | Download patch
« no previous file with comments | « test/fixedbugs/bug069.go ('k') | test/fixedbugs/bug234.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug196 1 // $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug196
2 2
3 // Copyright 2009 The Go Authors. All rights reserved. 3 // Copyright 2009 The Go Authors. All rights reserved.
4 // Use of this source code is governed by a BSD-style 4 // Use of this source code is governed by a BSD-style
5 // license that can be found in the LICENSE file. 5 // license that can be found in the LICENSE file.
6 6
7 package main 7 package main
8 8
9 var m = map[int]int{0: 0, 1: 0} 9 var m = map[int]int{0: 0, 1: 0}
10 var nf = 0 10 var nf = 0
11 var i int 11 var i int
12 12
13 func multi() (int, int) { return 1, 2 } 13 func multi() (int, int) { return 1, 2 }
14 14
15 func xxx() { 15 func xxx() {
16 » //TODO(rsc): uncomment when this syntax is valid for receive+check close d 16 » var c chan int
17 » //» var c chan int 17 » x, ok := <-c
18 » //» x, ok := <-c
19 18
20 var m map[int]int 19 var m map[int]int
21 » x, ok := m[1] 20 » x, ok = m[1]
22 21
23 var i interface{} 22 var i interface{}
24 var xx int 23 var xx int
25 xx, ok = i.(int) 24 xx, ok = i.(int)
26 25
27 a, b := multi() 26 a, b := multi()
28 27
29 _, _, _, _, _ = x, ok, xx, a, b 28 _, _, _, _, _ = x, ok, xx, a, b
30 } 29 }
31 30
(...skipping 10 matching lines...) Expand all
42 func main() { 41 func main() {
43 f()[0]++ 42 f()[0]++
44 f()[1] += 2 43 f()[1] += 2
45 *g() %= 2 44 *g() %= 2
46 if nf != 3 { 45 if nf != 3 {
47 println("too many calls:", nf) 46 println("too many calls:", nf)
48 panic("fail") 47 panic("fail")
49 } 48 }
50 49
51 } 50 }
OLDNEW
« no previous file with comments | « test/fixedbugs/bug069.go ('k') | test/fixedbugs/bug234.go » ('j') | no next file with comments »

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