Skip to content

Commit 556d234

Browse files
mpvlbradfitz
authored andcommitted
all: few tweaks to vet fixes
See golang/go#18085. And CL 80143. Change-Id: I2ac1eaf1d64a451fbdb7a1e32ad3774b3dabd2f5 Reviewed-on: https://go-review.googlesource.com/80596 Run-TryBot: Marcel van Lohuizen <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-by: Nigel Tao <[email protected]>
1 parent 75cc3ca commit 556d234

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

message/fmt_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1787,10 +1787,10 @@ func TestNilDoesNotBecomeTyped(t *testing.T) {
17871787
var a *A = nil
17881788
var b B = B{}
17891789

1790-
// indirect the Sprintf call through this f variable to avoid
1790+
// indirect the Sprintf call through this noVetWarn variable to avoid
17911791
// "go test" failing vet checks in Go 1.10+.
1792-
f := p.Sprintf
1793-
got := f("%s %s %s %s %s", nil, a, nil, b, nil)
1792+
noVetWarn := p.Sprintf
1793+
got := noVetWarn("%s %s %s %s %s", nil, a, nil, b, nil)
17941794

17951795
const expect = "%!s(<nil>) %!s(*message.A=<nil>) %!s(<nil>) {} %!s(<nil>)"
17961796
if got != expect {

number/format_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ func TestPluralIntegration(t *testing.T) {
9999
p := message.NewPrinter(language.English)
100100

101101
// Indirect the call to p.Sprintf through the variable f
102-
// to avoid Go 1.10+ go test failing a vet check.
102+
// to avoid Go tip failing a vet check.
103+
// TODO: remove once vet check has been fixed. See Issue #22936.
103104
f := p.Sprintf
104105
got := f("num %f", tc.f)
105106

0 commit comments

Comments
 (0)