summaryrefslogtreecommitdiff
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
commite37b45c553f866ff651efccb092694e7638c696b (patch)
tree2ad4647a66bf21bf56d761edba537c237b8e318a /test/varinit.go
parente080bcef69024ef4ff6798a20166bb6978ceb050 (diff)
downloadgo-e37b45c553f866ff651efccb092694e7638c696b.tar.gz
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 http://codereview.appspot.com/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 004f9c01b..c76877793 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")
+ }
}
}