Skip to content

Commit

Permalink
all: few tweaks to vet fixes
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
mpvl authored and bradfitz committed Dec 4, 2017
1 parent 75cc3ca commit 556d234
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions message/fmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1787,10 +1787,10 @@ func TestNilDoesNotBecomeTyped(t *testing.T) {
var a *A = nil
var b B = B{}

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

const expect = "%!s(<nil>) %!s(*message.A=<nil>) %!s(<nil>) {} %!s(<nil>)"
if got != expect {
Expand Down
3 changes: 2 additions & 1 deletion number/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ func TestPluralIntegration(t *testing.T) {
p := message.NewPrinter(language.English)

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

Expand Down

0 comments on commit 556d234

Please sign in to comment.