aboutsummaryrefslogtreecommitdiff
path: root/test/varinit.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-03-30 10:34:57 -0700
committerRuss Cox <rsc@golang.org>2010-03-30 10:34:57 -0700
commit00f9f0c0560ce35b9d006eacbeeacf897d19a2bf (patch)
treed56b07c89674ed7162eb30f924600574d0cf464b /test/varinit.go
parent5d0ec6c076978846f7cbbf4bd2c0dc55d946b0f9 (diff)
downloadgo-00f9f0c0560ce35b9d006eacbeeacf897d19a2bf.tar.gz
go-00f9f0c0560ce35b9d006eacbeeacf897d19a2bf.zip
single argument panic
note that sortmain.go has been run through hg gofmt; only the formatting of the day initializers changed. i'm happy to revert that formatting if you'd prefer. stop on error in doc/progs/run R=r CC=golang-dev https://golang.org/cl/850041
Diffstat (limited to 'test/varinit.go')
-rw-r--r--test/varinit.go21
1 files changed, 15 insertions, 6 deletions
diff --git a/test/varinit.go b/test/varinit.go
index 004f9c01b2..c768777932 100644
--- a/test/varinit.go
+++ b/test/varinit.go
@@ -7,14 +7,23 @@
package main
func main() {
- var x int = 1;
- if x != 1 { panic("found ", x, ", expected 1\n"); }
+ var x int = 1
+ if x != 1 {
+ print("found ", x, ", expected 1\n")
+ panic("fail")
+ }
{
- var x int = x + 1;
- if x != 2 { panic("found ", x, ", expected 2\n"); }
+ var x int = x + 1
+ if x != 2 {
+ print("found ", x, ", expected 2\n")
+ panic("fail")
+ }
}
{
- x := x + 1;
- if x != 2 { panic("found ", x, ", expected 2\n"); }
+ x := x + 1
+ if x != 2 {
+ print("found ", x, ", expected 2\n")
+ panic("fail")
+ }
}
}