Skip to content

Commit a715849

Browse files
valyalabradfitz
authored andcommitted
reflect: fix vet warnings
Updated #11041 Change-Id: I4a110ba8fefb367a1049b4a65dd20c39eb890ea2 Reviewed-on: https://go-review.googlesource.com/23080 Reviewed-by: Brad Fitzpatrick <[email protected]> Run-TryBot: Brad Fitzpatrick <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 5bd37b8 commit a715849

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/reflect/all_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -4210,7 +4210,7 @@ func TestStructOfExportRules(t *testing.T) {
42104210
}
42114211
exported := isExported(n)
42124212
if exported != test.exported {
4213-
t.Errorf("test-%d: got exported=%v want exported=%v", exported, test.exported)
4213+
t.Errorf("test-%d: got exported=%v want exported=%v", i, exported, test.exported)
42144214
}
42154215
})
42164216
}
@@ -4520,7 +4520,7 @@ func TestStructOfWithInterface(t *testing.T) {
45204520
if table.impl {
45214521
t.Errorf("test-%d: type=%v fails to implement Iface.\n", i, table.typ)
45224522
} else {
4523-
t.Errorf("test-%d: type=%v should NOT implement Iface\n", table.typ)
4523+
t.Errorf("test-%d: type=%v should NOT implement Iface\n", i, table.typ)
45244524
}
45254525
continue
45264526
}
@@ -4748,7 +4748,7 @@ func TestFuncOf(t *testing.T) {
47484748
if len(args) != 1 {
47494749
t.Errorf("args == %v, want exactly one arg", args)
47504750
} else if args[0].Type() != TypeOf(K("")) {
4751-
t.Errorf("args[0] is type %v, want %v", args[0].Type, TypeOf(K("")))
4751+
t.Errorf("args[0] is type %v, want %v", args[0].Type(), TypeOf(K("")))
47524752
} else if args[0].String() != "gopher" {
47534753
t.Errorf("args[0] = %q, want %q", args[0].String(), "gopher")
47544754
}
@@ -4760,7 +4760,7 @@ func TestFuncOf(t *testing.T) {
47604760
if len(outs) != 1 {
47614761
t.Fatalf("v.Call returned %v, want exactly one result", outs)
47624762
} else if outs[0].Type() != TypeOf(V(0)) {
4763-
t.Fatalf("c.Call[0] is type %v, want %v", outs[0].Type, TypeOf(V(0)))
4763+
t.Fatalf("c.Call[0] is type %v, want %v", outs[0].Type(), TypeOf(V(0)))
47644764
}
47654765
f := outs[0].Float()
47664766
if f != 3.14 {

src/reflect/type.go

-1
Original file line numberDiff line numberDiff line change
@@ -2758,7 +2758,6 @@ func typeptrdata(t *rtype) uintptr {
27582758
default:
27592759
panic("reflect.typeptrdata: unexpected type, " + t.String())
27602760
}
2761-
return 0
27622761
}
27632762

27642763
// See cmd/compile/internal/gc/reflect.go for derivation of constant.

0 commit comments

Comments
 (0)