Commit a7158497 authored by Aliaksandr Valialkin's avatar Aliaksandr Valialkin Committed by Brad Fitzpatrick

reflect: fix vet warnings

Updated #11041

Change-Id: I4a110ba8fefb367a1049b4a65dd20c39eb890ea2
Reviewed-on: https://go-review.googlesource.com/23080Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 5bd37b8e
...@@ -4210,7 +4210,7 @@ func TestStructOfExportRules(t *testing.T) { ...@@ -4210,7 +4210,7 @@ func TestStructOfExportRules(t *testing.T) {
} }
exported := isExported(n) exported := isExported(n)
if exported != test.exported { 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) { ...@@ -4520,7 +4520,7 @@ func TestStructOfWithInterface(t *testing.T) {
if table.impl { if table.impl {
t.Errorf("test-%d: type=%v fails to implement Iface.\n", i, table.typ) t.Errorf("test-%d: type=%v fails to implement Iface.\n", i, table.typ)
} else { } 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 continue
} }
...@@ -4748,7 +4748,7 @@ func TestFuncOf(t *testing.T) { ...@@ -4748,7 +4748,7 @@ func TestFuncOf(t *testing.T) {
if len(args) != 1 { if len(args) != 1 {
t.Errorf("args == %v, want exactly one arg", args) t.Errorf("args == %v, want exactly one arg", args)
} else if args[0].Type() != TypeOf(K("")) { } 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" { } else if args[0].String() != "gopher" {
t.Errorf("args[0] = %q, want %q", args[0].String(), "gopher") t.Errorf("args[0] = %q, want %q", args[0].String(), "gopher")
} }
...@@ -4760,7 +4760,7 @@ func TestFuncOf(t *testing.T) { ...@@ -4760,7 +4760,7 @@ func TestFuncOf(t *testing.T) {
if len(outs) != 1 { if len(outs) != 1 {
t.Fatalf("v.Call returned %v, want exactly one result", outs) t.Fatalf("v.Call returned %v, want exactly one result", outs)
} else if outs[0].Type() != TypeOf(V(0)) { } 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() f := outs[0].Float()
if f != 3.14 { if f != 3.14 {
......
...@@ -2758,7 +2758,6 @@ func typeptrdata(t *rtype) uintptr { ...@@ -2758,7 +2758,6 @@ func typeptrdata(t *rtype) uintptr {
default: default:
panic("reflect.typeptrdata: unexpected type, " + t.String()) panic("reflect.typeptrdata: unexpected type, " + t.String())
} }
return 0
} }
// See cmd/compile/internal/gc/reflect.go for derivation of constant. // See cmd/compile/internal/gc/reflect.go for derivation of constant.
......
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