aboutsummaryrefslogtreecommitdiff
path: root/test/defer.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2010-02-02 10:53:37 +1100
committerRob Pike <r@golang.org>2010-02-02 10:53:37 +1100
commitd2fc5d68da4c6410d71366e04b61d9e8fcb679b3 (patch)
tree5102f519f258e382a0657d658615ec38b4563611 /test/defer.go
parent1f11ece67f8b4d329dcf98ca0b214e4da515e446 (diff)
downloadgo-d2fc5d68da4c6410d71366e04b61d9e8fcb679b3.tar.gz
go-d2fc5d68da4c6410d71366e04b61d9e8fcb679b3.zip
Change type of Printf's args to ... interface{}
R=rsc CC=golang-dev https://golang.org/cl/197043
Diffstat (limited to 'test/defer.go')
-rw-r--r--test/defer.go24
1 files changed, 10 insertions, 14 deletions
diff --git a/test/defer.go b/test/defer.go
index 19730a5ead..8b8312235d 100644
--- a/test/defer.go
+++ b/test/defer.go
@@ -10,9 +10,7 @@ import "fmt"
var result string
-func addInt(i int) {
- result += fmt.Sprint(i)
-}
+func addInt(i int) { result += fmt.Sprint(i) }
func test1helper() {
for i := 0; i < 10; i++ {
@@ -21,16 +19,14 @@ func test1helper() {
}
func test1() {
- result = "";
- test1helper();
+ result = ""
+ test1helper()
if result != "9876543210" {
- fmt.Printf("test1: bad defer result (should be 9876543210): %q\n", result);
+ fmt.Printf("test1: bad defer result (should be 9876543210): %q\n", result)
}
}
-func addDotDotDot(v ...) {
- result += fmt.Sprint(v)
-}
+func addDotDotDot(v ...interface{}) { result += fmt.Sprint(v) }
func test2helper() {
for i := 0; i < 10; i++ {
@@ -39,14 +35,14 @@ func test2helper() {
}
func test2() {
- result = "";
- test2helper();
+ result = ""
+ test2helper()
if result != "9876543210" {
- fmt.Printf("test2: bad defer result (should be 9876543210): %q\n", result);
+ fmt.Printf("test2: bad defer result (should be 9876543210): %q\n", result)
}
}
func main() {
- test1();
- test2();
+ test1()
+ test2()
}