Commit 8b8c103b authored by Russ Cox's avatar Russ Cox

fix build - misc ... vs ...T fixes

TBR=r
CC=golang-dev
https://golang.org/cl/198081
parent cd4a6842
...@@ -8,7 +8,6 @@ import ( ...@@ -8,7 +8,6 @@ import (
"bytes" "bytes"
"io/ioutil" "io/ioutil"
"os" "os"
"reflect"
"strings" "strings"
"testing" "testing"
) )
...@@ -34,11 +33,8 @@ var pairs = []testpair{ ...@@ -34,11 +33,8 @@ var pairs = []testpair{
var bigtest = pairs[len(pairs)-1] var bigtest = pairs[len(pairs)-1]
func testEqual(t *testing.T, msg string, args ...) bool { func testEqual(t *testing.T, msg string, args ...interface{}) bool {
v := reflect.NewValue(args).(*reflect.StructValue) if args[len(args)-2] != args[len(args)-1] {
v1 := v.Field(v.NumField() - 2)
v2 := v.Field(v.NumField() - 1)
if v1.Interface() != v2.Interface() {
t.Errorf(msg, args) t.Errorf(msg, args)
return false return false
} }
......
...@@ -8,7 +8,6 @@ import ( ...@@ -8,7 +8,6 @@ import (
"bytes" "bytes"
"io/ioutil" "io/ioutil"
"os" "os"
"reflect"
"strings" "strings"
"testing" "testing"
) )
...@@ -48,11 +47,8 @@ var bigtest = testpair{ ...@@ -48,11 +47,8 @@ var bigtest = testpair{
"VHdhcyBicmlsbGlnLCBhbmQgdGhlIHNsaXRoeSB0b3Zlcw==", "VHdhcyBicmlsbGlnLCBhbmQgdGhlIHNsaXRoeSB0b3Zlcw==",
} }
func testEqual(t *testing.T, msg string, args ...) bool { func testEqual(t *testing.T, msg string, args ...interface{}) bool {
v := reflect.NewValue(args).(*reflect.StructValue) if args[len(args)-2] != args[len(args)-1] {
v1 := v.Field(v.NumField() - 2)
v2 := v.Field(v.NumField() - 1)
if v1.Interface() != v2.Interface() {
t.Errorf(msg, args) t.Errorf(msg, args)
return false return false
} }
......
...@@ -8,7 +8,6 @@ import ( ...@@ -8,7 +8,6 @@ import (
"bytes" "bytes"
"io/ioutil" "io/ioutil"
"os" "os"
"reflect"
"strings" "strings"
"testing" "testing"
) )
...@@ -17,11 +16,8 @@ type testpair struct { ...@@ -17,11 +16,8 @@ type testpair struct {
decoded, encoded string decoded, encoded string
} }
func testEqual(t *testing.T, msg string, args ...) bool { func testEqual(t *testing.T, msg string, args ...interface{}) bool {
v := reflect.NewValue(args).(*reflect.StructValue) if args[len(args)-2] != args[len(args)-1] {
v1 := v.Field(v.NumField() - 2)
v2 := v.Field(v.NumField() - 1)
if v1.Interface() != v2.Interface() {
t.Errorf(msg, args) t.Errorf(msg, args)
return false return false
} }
......
...@@ -721,7 +721,8 @@ func (f Format) Sprint(args ...) string { ...@@ -721,7 +721,8 @@ func (f Format) Sprint(args ...) string {
var buf bytes.Buffer var buf bytes.Buffer
_, err := f.Fprint(&buf, nil, args) _, err := f.Fprint(&buf, nil, args)
if err != nil { 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() return buf.String()
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment