aboutsummaryrefslogtreecommitdiff
path: root/test/fixedbugs/bug199.go
diff options
context:
space:
mode:
Diffstat (limited to 'test/fixedbugs/bug199.go')
-rw-r--r--test/fixedbugs/bug199.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/fixedbugs/bug199.go b/test/fixedbugs/bug199.go
index c7bd21f11b..71226290f1 100644
--- a/test/fixedbugs/bug199.go
+++ b/test/fixedbugs/bug199.go
@@ -7,19 +7,21 @@
package main
type S struct {
- a []int;
+ a []int
}
+
var s = &S{make([]int, 10)}
func main() {
- s.a[f()] = 1 // 6g used to call f twice here
+ s.a[f()] = 1 // 6g used to call f twice here
}
var n int
-func f() int{
+
+func f() int {
if n++; n > 1 {
- panicln("f twice");
+ println("f twice")
+ panic("fail")
}
return 0
}
-