summaryrefslogtreecommitdiff
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
commit5773c0a2e1e96e8976626ae40c52abf17fd8ac6d (patch)
tree8f498db4a8c2191481b79772b51d82547316fbf3 /test/defer.go
parentfbd5c8be15db89994bdf4c166359750ee5add677 (diff)
downloadgo-5773c0a2e1e96e8976626ae40c52abf17fd8ac6d.tar.gz
Change type of Printf's args to ... interface{}
R=rsc CC=golang-dev http://codereview.appspot.com/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 19730a5ea..8b8312235 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()
}