Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(17295)

Issue 198081: code review 198081: fix build - misc ... vs ...T fixes (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 2 months ago by rsc
Modified:
14 years, 2 months ago
Reviewers:
CC:
r, golang-dev
Visibility:
Public.

Description

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

Patch Set 1 #

Patch Set 2 : code review 198081: fix build - misc ... vs ...T fixes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+8 lines, -19 lines) Patch
M src/pkg/encoding/ascii85/ascii85_test.go View 2 chunks +2 lines, -6 lines 0 comments Download
M src/pkg/encoding/base64/base64_test.go View 2 chunks +2 lines, -6 lines 0 comments Download
M src/pkg/encoding/git85/git_test.go View 2 chunks +2 lines, -6 lines 0 comments Download
M src/pkg/exp/datafmt/datafmt.go View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 3
rsc
Hello r (cc: golang-dev@googlegroups.com), I'd like you to review this change.
14 years, 2 months ago (2010-02-03 02:19:25 UTC) #1
rsc
*** Submitted as http://code.google.com/p/go/source/detail?r=36e71486f51f *** fix build - misc ... vs ...T fixes TBR=r CC=golang-dev ...
14 years, 2 months ago (2010-02-03 02:19:29 UTC) #2
r2
14 years, 2 months ago (2010-02-03 02:42:19 UTC) #3
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()
> }
>
>

Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b