summaryrefslogtreecommitdiff
path: root/test/indirect.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2010-03-24 16:46:53 -0700
committerRob Pike <r@golang.org>2010-03-24 16:46:53 -0700
commit325cf8ef217b4e9ae2caf53fa0d4534cd5003bd8 (patch)
tree72405fbc32b0bef0850cac2797f818bccc12b44e /test/indirect.go
parentacfd6d5f055ca5283dff5de16390c1d0cfc9f0ca (diff)
downloadgo-git-325cf8ef217b4e9ae2caf53fa0d4534cd5003bd8.tar.gz
delete all uses of panicln by rewriting them using panic or,
in the tests, println+panic. gofmt some tests too. R=rsc CC=golang-dev https://golang.org/cl/741041
Diffstat (limited to 'test/indirect.go')
-rw-r--r--test/indirect.go41
1 files changed, 22 insertions, 19 deletions
diff --git a/test/indirect.go b/test/indirect.go
index 06c1dcce7b..cfddde9ce2 100644
--- a/test/indirect.go
+++ b/test/indirect.go
@@ -32,7 +32,7 @@ func crash() {
// these uses of nil pointers
// would crash but should type check
println("crash",
- len(a1) + cap(a1));
+ len(a1)+cap(a1))
}
func nocrash() {
@@ -42,41 +42,44 @@ func nocrash() {
// it decides there are type errors.
// it might also help in the traceback.
x :=
- len(m0)+
- len(m3);
+ len(m0) +
+ len(m3)
if x != 1 {
- panicln("wrong maplen");
+ println("wrong maplen")
+ panic("fail")
}
x =
- len(s0)+
- len(s3);
+ len(s0) +
+ len(s3)
if x != 1 {
- panicln("wrong stringlen");
+ println("wrong stringlen")
+ panic("fail")
}
x =
- len(a0)+
- len(a2);
+ len(a0) +
+ len(a2)
if x != 20 {
- panicln("wrong arraylen");
+ println("wrong arraylen")
+ panic("fail")
}
x =
- len(b0)+
- len(b3);
+ len(b0) +
+ len(b3)
if x != 3 {
- panicln("wrong slicelen");
+ println("wrong slicelen")
+ panic("fail")
}
x =
- cap(b0)+
- cap(b3);
+ cap(b0) +
+ cap(b3)
if x != 3 {
- panicln("wrong slicecap");
+ println("wrong slicecap")
+ panic("fail")
}
}
-func main() {
- nocrash();
-}
+func main() { nocrash() }