Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change.
*** Submitted as http://code.google.com/p/go/source/detail?r=36e71486f51f *** fix build - misc ... vs ...T fixes TBR=r CC=golang-dev http://codereview.appspot.com/198081
LGTM On Feb 3, 2010, at 1:19 PM, rsc@golang.org wrote: > Reviewers: r, > > Message: > Hello r (cc: golang-dev@googlegroups.com), > > I'd like you to review this change. > > > Description: > fix build - misc ... vs ...T fixes > > Please review this at http://codereview.appspot.com/198081/show > > Affected files: > M src/pkg/encoding/ascii85/ascii85_test.go > M src/pkg/encoding/base64/base64_test.go > M src/pkg/encoding/git85/git_test.go > M src/pkg/exp/datafmt/datafmt.go > > > Index: src/pkg/encoding/ascii85/ascii85_test.go > =================================================================== > --- a/src/pkg/encoding/ascii85/ascii85_test.go > +++ b/src/pkg/encoding/ascii85/ascii85_test.go > @@ -8,7 +8,6 @@ > "bytes" > "io/ioutil" > "os" > - "reflect" > "strings" > "testing" > ) > @@ -34,11 +33,8 @@ > > var bigtest = pairs[len(pairs)-1] > > -func testEqual(t *testing.T, msg string, args ...) bool { > - v := reflect.NewValue(args).(*reflect.StructValue) > - v1 := v.Field(v.NumField() - 2) > - v2 := v.Field(v.NumField() - 1) > - if v1.Interface() != v2.Interface() { > +func testEqual(t *testing.T, msg string, args ...interface{}) bool { > + if args[len(args)-2] != args[len(args)-1] { > t.Errorf(msg, args) > return false > } > Index: src/pkg/encoding/base64/base64_test.go > =================================================================== > --- a/src/pkg/encoding/base64/base64_test.go > +++ b/src/pkg/encoding/base64/base64_test.go > @@ -8,7 +8,6 @@ > "bytes" > "io/ioutil" > "os" > - "reflect" > "strings" > "testing" > ) > @@ -48,11 +47,8 @@ > "VHdhcyBicmlsbGlnLCBhbmQgdGhlIHNsaXRoeSB0b3Zlcw==", > } > > -func testEqual(t *testing.T, msg string, args ...) bool { > - v := reflect.NewValue(args).(*reflect.StructValue) > - v1 := v.Field(v.NumField() - 2) > - v2 := v.Field(v.NumField() - 1) > - if v1.Interface() != v2.Interface() { > +func testEqual(t *testing.T, msg string, args ...interface{}) bool { > + if args[len(args)-2] != args[len(args)-1] { > t.Errorf(msg, args) > return false > } > Index: src/pkg/encoding/git85/git_test.go > =================================================================== > --- a/src/pkg/encoding/git85/git_test.go > +++ b/src/pkg/encoding/git85/git_test.go > @@ -8,7 +8,6 @@ > "bytes" > "io/ioutil" > "os" > - "reflect" > "strings" > "testing" > ) > @@ -17,11 +16,8 @@ > decoded, encoded string > } > > -func testEqual(t *testing.T, msg string, args ...) bool { > - v := reflect.NewValue(args).(*reflect.StructValue) > - v1 := v.Field(v.NumField() - 2) > - v2 := v.Field(v.NumField() - 1) > - if v1.Interface() != v2.Interface() { > +func testEqual(t *testing.T, msg string, args ...interface{}) bool { > + if args[len(args)-2] != args[len(args)-1] { > t.Errorf(msg, args) > return false > } > Index: src/pkg/exp/datafmt/datafmt.go > =================================================================== > --- a/src/pkg/exp/datafmt/datafmt.go > +++ b/src/pkg/exp/datafmt/datafmt.go > @@ -721,7 +721,8 @@ > var buf bytes.Buffer > _, err := f.Fprint(&buf, nil, args) > if err != nil { > - fmt.Fprintf(&buf, "--- Sprint(%s) failed: %v", fmt.Sprint(args), > err) > + var i interface{} = args > + fmt.Fprintf(&buf, "--- Sprint(%s) failed: %v", fmt.Sprint(i), err) > } > return buf.String() > } > >