]> Cypherpunks repositories - gostls13.git/commitdiff
fix build - misc ... vs ...T fixes
authorRuss Cox <rsc@golang.org>
Wed, 3 Feb 2010 02:19:27 +0000 (18:19 -0800)
committerRuss Cox <rsc@golang.org>
Wed, 3 Feb 2010 02:19:27 +0000 (18:19 -0800)
TBR=r
CC=golang-dev
https://golang.org/cl/198081

src/pkg/encoding/ascii85/ascii85_test.go
src/pkg/encoding/base64/base64_test.go
src/pkg/encoding/git85/git_test.go
src/pkg/exp/datafmt/datafmt.go

index 7eb245ee26b220137073a55b328acd54dbc86048..3219d49e0f1ab89c9de9f7f6bf8c62c4be17bfdb 100644 (file)
@@ -8,7 +8,6 @@ import (
        "bytes"
        "io/ioutil"
        "os"
-       "reflect"
        "strings"
        "testing"
 )
@@ -34,11 +33,8 @@ var pairs = []testpair{
 
 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 fe66cff7e667e99a81fd799ea56df4a0fd7ad9b1..f26f8f2ce56bcbcd5f1451bf27d45c887dcd4118 100644 (file)
@@ -8,7 +8,6 @@ import (
        "bytes"
        "io/ioutil"
        "os"
-       "reflect"
        "strings"
        "testing"
 )
@@ -48,11 +47,8 @@ var bigtest = testpair{
        "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 4a42282fe4c4e2f1011ba936fcce112281bb43c0..0eb65129d32f60ed4167e8c524490593bcdf7aff 100644 (file)
@@ -8,7 +8,6 @@ import (
        "bytes"
        "io/ioutil"
        "os"
-       "reflect"
        "strings"
        "testing"
 )
@@ -17,11 +16,8 @@ type testpair struct {
        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 cd9af2b6ac540b4410cb23179f7f726266ed7479..7472a97a93775124bd2a0d814a946f6429c7ff52 100644 (file)
@@ -721,7 +721,8 @@ func (f Format) Sprint(args ...) string {
        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()
 }