aboutsummaryrefslogtreecommitdiff
path: root/test/method3.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/method3.go
parentacfd6d5f055ca5283dff5de16390c1d0cfc9f0ca (diff)
downloadgo-325cf8ef217b4e9ae2caf53fa0d4534cd5003bd8.tar.gz
go-325cf8ef217b4e9ae2caf53fa0d4534cd5003bd8.zip
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/method3.go')
-rw-r--r--test/method3.go18
1 files changed, 11 insertions, 7 deletions
diff --git a/test/method3.go b/test/method3.go
index 20ced1eb23..7946a87502 100644
--- a/test/method3.go
+++ b/test/method3.go
@@ -8,7 +8,8 @@
package main
-type T [] int
+type T []int
+
func (t T) Len() int { return len(t) }
type I interface {
@@ -16,16 +17,19 @@ type I interface {
}
func main() {
- var t T = T{0,1,2,3,4};
- var i I;
- i = t;
+ var t T = T{0, 1, 2, 3, 4}
+ var i I
+ i = t
if i.Len() != 5 {
- panicln("i.Len", i.Len());
+ println("i.Len", i.Len())
+ panic("fail")
}
if T.Len(t) != 5 {
- panicln("T.Len", T.Len(t));
+ println("T.Len", T.Len(t))
+ panic("fail")
}
if (*T).Len(&t) != 5 {
- panicln("(*T).Len", (*T).Len(&t));
+ println("(*T).Len", (*T).Len(&t))
+ panic("fail")
}
}