From a71584975dedd4f4975d65047ec7660191a49613 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Thu, 12 May 2016 15:00:10 +0300 Subject: [PATCH] reflect: fix vet warnings Updated #11041 Change-Id: I4a110ba8fefb367a1049b4a65dd20c39eb890ea2 Reviewed-on: https://go-review.googlesource.com/23080 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- src/reflect/all_test.go | 8 ++++---- src/reflect/type.go | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/reflect/all_test.go b/src/reflect/all_test.go index 1a7952d789..5beec63273 100644 --- a/src/reflect/all_test.go +++ b/src/reflect/all_test.go @@ -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 { diff --git a/src/reflect/type.go b/src/reflect/type.go index b499d01a2c..5c6e3d5500 100644 --- a/src/reflect/type.go +++ b/src/reflect/type.go @@ -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. -- 2.50.0