aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vet
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2023-05-08 13:38:04 -0400
committerRuss Cox <rsc@golang.org>2023-05-09 01:28:01 +0000
commite5e61a03d9f448977c233a2b023e56535fcd705e (patch)
tree16edae3220ca83db94be10b6857cc805d8d06494 /src/cmd/vet
parent3c3b1d39bee6d208ab437e24ba942fbae789eb7f (diff)
downloadgo-e5e61a03d9f448977c233a2b023e56535fcd705e.tar.xz
cmd: go get golang.org/x/tools@8f7fb01dd429 and revendor
go get golang.org/x/tools@8f7fb01dd429 # CL 493619 go mod tidy go mod vendor The goal is to set up for importing the bisect command, for use in tests, in a follow-up CL. This also updates x/sys and x/net, including in std, because x/tools now depends on newer versions of those. Change-Id: I24c283cc165464d9c873ba7a9a4e75a9d02919b2 Reviewed-on: https://go-review.googlesource.com/c/go/+/493596 Reviewed-by: Alan Donovan <adonovan@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/cmd/vet')
-rw-r--r--src/cmd/vet/testdata/print/print.go42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/cmd/vet/testdata/print/print.go b/src/cmd/vet/testdata/print/print.go
index 46240e87bf..a2ad0f1298 100644
--- a/src/cmd/vet/testdata/print/print.go
+++ b/src/cmd/vet/testdata/print/print.go
@@ -140,9 +140,9 @@ func PrintfTests() {
fmt.Printf("%s", nonemptyinterface) // correct (the type is responsible for formatting)
fmt.Printf("%.*s %d %6g", 3, "hi", 23, 'x') // ERROR "Printf format %6g has arg 'x' of wrong type rune"
fmt.Println() // not an error
- fmt.Println("%s", "hi") // ERROR "Println call has possible formatting directive %s"
- fmt.Println("%v", "hi") // ERROR "Println call has possible formatting directive %v"
- fmt.Println("%T", "hi") // ERROR "Println call has possible formatting directive %T"
+ fmt.Println("%s", "hi") // ERROR "Println call has possible Printf formatting directive %s"
+ fmt.Println("%v", "hi") // ERROR "Println call has possible Printf formatting directive %v"
+ fmt.Println("%T", "hi") // ERROR "Println call has possible Printf formatting directive %T"
fmt.Println("0.0%") // correct (trailing % couldn't be a formatting directive)
fmt.Printf("%s", "hi", 3) // ERROR "Printf call needs 1 arg but has 2 args"
_ = fmt.Sprintf("%"+("s"), "hi", 3) // ERROR "Sprintf call needs 1 arg but has 2 args"
@@ -165,19 +165,19 @@ func PrintfTests() {
Printf(format, "hi") // ERROR "Printf format %s reads arg #2, but call has 1 arg$"
Printf("%s %d %.3v %q", "str", 4) // ERROR "Printf format %.3v reads arg #3, but call has 2 args"
f := new(ptrStringer)
- f.Warn(0, "%s", "hello", 3) // ERROR "Warn call has possible formatting directive %s"
+ f.Warn(0, "%s", "hello", 3) // ERROR "Warn call has possible Printf formatting directive %s"
f.Warnf(0, "%s", "hello", 3) // ERROR "Warnf call needs 1 arg but has 2 args"
f.Warnf(0, "%r", "hello") // ERROR "Warnf format %r has unknown verb r"
f.Warnf(0, "%#s", "hello") // ERROR "Warnf format %#s has unrecognized flag #"
- f.Warn2(0, "%s", "hello", 3) // ERROR "Warn2 call has possible formatting directive %s"
+ f.Warn2(0, "%s", "hello", 3) // ERROR "Warn2 call has possible Printf formatting directive %s"
f.Warnf2(0, "%s", "hello", 3) // ERROR "Warnf2 call needs 1 arg but has 2 args"
f.Warnf2(0, "%r", "hello") // ERROR "Warnf2 format %r has unknown verb r"
f.Warnf2(0, "%#s", "hello") // ERROR "Warnf2 format %#s has unrecognized flag #"
- f.Wrap(0, "%s", "hello", 3) // ERROR "Wrap call has possible formatting directive %s"
+ f.Wrap(0, "%s", "hello", 3) // ERROR "Wrap call has possible Printf formatting directive %s"
f.Wrapf(0, "%s", "hello", 3) // ERROR "Wrapf call needs 1 arg but has 2 args"
f.Wrapf(0, "%r", "hello") // ERROR "Wrapf format %r has unknown verb r"
f.Wrapf(0, "%#s", "hello") // ERROR "Wrapf format %#s has unrecognized flag #"
- f.Wrap2(0, "%s", "hello", 3) // ERROR "Wrap2 call has possible formatting directive %s"
+ f.Wrap2(0, "%s", "hello", 3) // ERROR "Wrap2 call has possible Printf formatting directive %s"
f.Wrapf2(0, "%s", "hello", 3) // ERROR "Wrapf2 call needs 1 arg but has 2 args"
f.Wrapf2(0, "%r", "hello") // ERROR "Wrapf2 format %r has unknown verb r"
f.Wrapf2(0, "%#s", "hello") // ERROR "Wrapf2 format %#s has unrecognized flag #"
@@ -213,7 +213,7 @@ func PrintfTests() {
var et1 *testing.T
et1.Error() // ok
et1.Error("hi") // ok
- et1.Error("%d", 3) // ERROR "Error call has possible formatting directive %d"
+ et1.Error("%d", 3) // ERROR "Error call has possible Printf formatting directive %d"
var et3 errorTest3
et3.Error() // ok, not an error method.
var et4 errorTest4
@@ -239,7 +239,7 @@ func PrintfTests() {
// Special handling for Log.
math.Log(3) // OK
var t *testing.T
- t.Log("%d", 3) // ERROR "Log call has possible formatting directive %d"
+ t.Log("%d", 3) // ERROR "Log call has possible Printf formatting directive %d"
t.Logf("%d", 3)
t.Logf("%d", "hi") // ERROR "Logf format %d has arg \x22hi\x22 of wrong type string"
@@ -290,27 +290,27 @@ func PrintfTests() {
Printf(someString(), "hello") // OK
// Printf wrappers in package log should be detected automatically
- logpkg.Fatal("%d", 1) // ERROR "Fatal call has possible formatting directive %d"
+ logpkg.Fatal("%d", 1) // ERROR "Fatal call has possible Printf formatting directive %d"
logpkg.Fatalf("%d", "x") // ERROR "Fatalf format %d has arg \x22x\x22 of wrong type string"
- logpkg.Fatalln("%d", 1) // ERROR "Fatalln call has possible formatting directive %d"
- logpkg.Panic("%d", 1) // ERROR "Panic call has possible formatting directive %d"
+ logpkg.Fatalln("%d", 1) // ERROR "Fatalln call has possible Printf formatting directive %d"
+ logpkg.Panic("%d", 1) // ERROR "Panic call has possible Printf formatting directive %d"
logpkg.Panicf("%d", "x") // ERROR "Panicf format %d has arg \x22x\x22 of wrong type string"
- logpkg.Panicln("%d", 1) // ERROR "Panicln call has possible formatting directive %d"
- logpkg.Print("%d", 1) // ERROR "Print call has possible formatting directive %d"
+ logpkg.Panicln("%d", 1) // ERROR "Panicln call has possible Printf formatting directive %d"
+ logpkg.Print("%d", 1) // ERROR "Print call has possible Printf formatting directive %d"
logpkg.Printf("%d", "x") // ERROR "Printf format %d has arg \x22x\x22 of wrong type string"
- logpkg.Println("%d", 1) // ERROR "Println call has possible formatting directive %d"
+ logpkg.Println("%d", 1) // ERROR "Println call has possible Printf formatting directive %d"
// Methods too.
var l *logpkg.Logger
- l.Fatal("%d", 1) // ERROR "Fatal call has possible formatting directive %d"
+ l.Fatal("%d", 1) // ERROR "Fatal call has possible Printf formatting directive %d"
l.Fatalf("%d", "x") // ERROR "Fatalf format %d has arg \x22x\x22 of wrong type string"
- l.Fatalln("%d", 1) // ERROR "Fatalln call has possible formatting directive %d"
- l.Panic("%d", 1) // ERROR "Panic call has possible formatting directive %d"
+ l.Fatalln("%d", 1) // ERROR "Fatalln call has possible Printf formatting directive %d"
+ l.Panic("%d", 1) // ERROR "Panic call has possible Printf formatting directive %d"
l.Panicf("%d", "x") // ERROR "Panicf format %d has arg \x22x\x22 of wrong type string"
- l.Panicln("%d", 1) // ERROR "Panicln call has possible formatting directive %d"
- l.Print("%d", 1) // ERROR "Print call has possible formatting directive %d"
+ l.Panicln("%d", 1) // ERROR "Panicln call has possible Printf formatting directive %d"
+ l.Print("%d", 1) // ERROR "Print call has possible Printf formatting directive %d"
l.Printf("%d", "x") // ERROR "Printf format %d has arg \x22x\x22 of wrong type string"
- l.Println("%d", 1) // ERROR "Println call has possible formatting directive %d"
+ l.Println("%d", 1) // ERROR "Println call has possible Printf formatting directive %d"
// Issue 26486
dbg("", 1) // no error "call has arguments but no formatting directive"