]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: fix vet warnings
authorAliaksandr Valialkin <valyala@gmail.com>
Thu, 12 May 2016 12:00:10 +0000 (15:00 +0300)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 12 May 2016 15:58:28 +0000 (15:58 +0000)
Updated #11041

Change-Id: I4a110ba8fefb367a1049b4a65dd20c39eb890ea2
Reviewed-on: https://go-review.googlesource.com/23080
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/reflect/all_test.go
src/reflect/type.go

index 1a7952d7892d8346096a329fa89f425ea172439a..5beec63273b52695ff164efec8cb2e4c86aac184 100644 (file)
@@ -4210,7 +4210,7 @@ func TestStructOfExportRules(t *testing.T) {
                        }
                        exported := isExported(n)
                        if exported != test.exported {
-                               t.Errorf("test-%d: got exported=%v want exported=%v", exported, test.exported)
+                               t.Errorf("test-%d: got exported=%v want exported=%v", i, exported, test.exported)
                        }
                })
        }
@@ -4520,7 +4520,7 @@ func TestStructOfWithInterface(t *testing.T) {
                        if table.impl {
                                t.Errorf("test-%d: type=%v fails to implement Iface.\n", i, table.typ)
                        } else {
-                               t.Errorf("test-%d: type=%v should NOT implement Iface\n", table.typ)
+                               t.Errorf("test-%d: type=%v should NOT implement Iface\n", i, table.typ)
                        }
                        continue
                }
@@ -4748,7 +4748,7 @@ func TestFuncOf(t *testing.T) {
                if len(args) != 1 {
                        t.Errorf("args == %v, want exactly one arg", args)
                } else if args[0].Type() != TypeOf(K("")) {
-                       t.Errorf("args[0] is type %v, want %v", args[0].Type, TypeOf(K("")))
+                       t.Errorf("args[0] is type %v, want %v", args[0].Type(), TypeOf(K("")))
                } else if args[0].String() != "gopher" {
                        t.Errorf("args[0] = %q, want %q", args[0].String(), "gopher")
                }
@@ -4760,7 +4760,7 @@ func TestFuncOf(t *testing.T) {
        if len(outs) != 1 {
                t.Fatalf("v.Call returned %v, want exactly one result", outs)
        } else if outs[0].Type() != TypeOf(V(0)) {
-               t.Fatalf("c.Call[0] is type %v, want %v", outs[0].Type, TypeOf(V(0)))
+               t.Fatalf("c.Call[0] is type %v, want %v", outs[0].Type(), TypeOf(V(0)))
        }
        f := outs[0].Float()
        if f != 3.14 {
index b499d01a2c734619784c0797abb97e36cb747459..5c6e3d55009d7ece6e7cfd7fcf70eb5eef38afb8 100644 (file)
@@ -2758,7 +2758,6 @@ func typeptrdata(t *rtype) uintptr {
        default:
                panic("reflect.typeptrdata: unexpected type, " + t.String())
        }
-       return 0
 }
 
 // See cmd/compile/internal/gc/reflect.go for derivation of constant.