| // Copyright 2009 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| func addInt(i int) { result += fmt.Sprint(i) } |
| for i := 0; i < 10; i++ { |
| if result != "9876543210" { |
| fmt.Printf("test1: bad defer result (should be 9876543210): %q\n", result) |
| func addDotDotDot(v ...interface{}) { result += fmt.Sprint(v...) } |
| for i := 0; i < 10; i++ { |
| if result != "9876543210" { |
| fmt.Printf("test2: bad defer result (should be 9876543210): %q\n", result) |