summaryrefslogtreecommitdiff
path: root/src/pkg/encoding
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/encoding')
-rw-r--r--src/pkg/encoding/ascii85/ascii85_test.go8
-rw-r--r--src/pkg/encoding/base64/base64_test.go8
-rw-r--r--src/pkg/encoding/git85/git_test.go8
3 files changed, 6 insertions, 18 deletions
diff --git a/src/pkg/encoding/ascii85/ascii85_test.go b/src/pkg/encoding/ascii85/ascii85_test.go
index 7eb245ee2..3219d49e0 100644
--- a/src/pkg/encoding/ascii85/ascii85_test.go
+++ b/src/pkg/encoding/ascii85/ascii85_test.go
@@ -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
}
diff --git a/src/pkg/encoding/base64/base64_test.go b/src/pkg/encoding/base64/base64_test.go
index fe66cff7e..f26f8f2ce 100644
--- a/src/pkg/encoding/base64/base64_test.go
+++ b/src/pkg/encoding/base64/base64_test.go
@@ -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
}
diff --git a/src/pkg/encoding/git85/git_test.go b/src/pkg/encoding/git85/git_test.go
index 4a42282fe..0eb65129d 100644
--- a/src/pkg/encoding/git85/git_test.go
+++ b/src/pkg/encoding/git85/git_test.go
@@ -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
}