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

Delta Between Two Patch Sets: test/fixedbugs/bug262.go

Issue 5307066: code review 5307066: non-pkg: gofix -r error (Closed)
Left Patch Set: Created 13 years, 4 months ago
Right Patch Set: diff -r 586479483dd6 https://go.googlecode.com/hg/ Created 13 years, 4 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:
Right: Side by side diff | Download
« no previous file with change/comment | « test/fixedbugs/bug243.go ('k') | test/fixedbugs/bug286.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // $G $D/$F.go && $L $F.$A && ./$A.out 1 // $G $D/$F.go && $L $F.$A && ./$A.out
2 2
3 // Copyright 2010 The Go Authors. All rights reserved. 3 // Copyright 2010 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 import ( 9 import (
10 "os" 10 "os"
11 "strconv" 11 "strconv"
12 ) 12 )
13 13
14 var trace string 14 var trace string
15 15
16 func f() string { 16 func f() string {
17 trace += "f" 17 trace += "f"
18 return "abc" 18 return "abc"
19 } 19 }
20 20
21 func g() *os.Error { 21 func g() *error {
22 trace += "g" 22 trace += "g"
23 » var x os.Error 23 » var x error
24 return &x 24 return &x
25 } 25 }
26 26
27 func h() string { 27 func h() string {
28 trace += "h" 28 trace += "h"
29 return "123" 29 return "123"
30 } 30 }
31 31
32 func i() *int { 32 func i() *int {
33 trace += "i" 33 trace += "i"
34 var i int 34 var i int
35 return &i 35 return &i
36 } 36 }
37 37
38
39 func main() { 38 func main() {
40 m := make(map[string]int) 39 m := make(map[string]int)
41 m[f()], *g() = strconv.Atoi(h()) 40 m[f()], *g() = strconv.Atoi(h())
42 if m["abc"] != 123 || trace != "fgh" { 41 if m["abc"] != 123 || trace != "fgh" {
43 println("BUG", m["abc"], trace) 42 println("BUG", m["abc"], trace)
44 panic("fail") 43 panic("fail")
45 } 44 }
46 » mm := make(map[string]os.Error) 45 » mm := make(map[string]error)
47 trace = "" 46 trace = ""
48 mm["abc"] = os.EINVAL 47 mm["abc"] = os.EINVAL
49 *i(), mm[f()] = strconv.Atoi(h()) 48 *i(), mm[f()] = strconv.Atoi(h())
50 if mm["abc"] != nil || trace != "ifh" { 49 if mm["abc"] != nil || trace != "ifh" {
51 println("BUG1", mm["abc"], trace) 50 println("BUG1", mm["abc"], trace)
52 panic("fail") 51 panic("fail")
53 } 52 }
54 } 53 }
LEFTRIGHT

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