Skip to content

Commit 72275c0

Browse files
cespareadonovan
authored andcommitted
cmd/vet: re-vendor x/tools upstream for printf verb fix
This pulls in the x/tools fix from https://go-review.googlesource.com/c/tools/+/202041 so that cmd/vet won't flag %x/%X verbs incorrectly for floating-point and complex types. Fixes #34993 Change-Id: I68d89a19d95fe6ad336e87d12d56f03556974086 Reviewed-on: https://go-review.googlesource.com/c/go/+/202083 Run-TryBot: Caleb Spare <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
1 parent e9c9949 commit 72275c0

File tree

7 files changed

+8
-21
lines changed

7 files changed

+8
-21
lines changed

src/cmd/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ require (
88
golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1
99
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c
1010
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 // indirect
11-
golang.org/x/tools v0.0.0-20190925211824-e4ea94538f5b
11+
golang.org/x/tools v0.0.0-20191018203202-04252eccb9d5
1212
)

src/cmd/go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 h1:vsphBvatvfbhlb4PO1BYSr9dz
1414
golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
1515
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
1616
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
17-
golang.org/x/tools v0.0.0-20190925211824-e4ea94538f5b h1:gyG4T6EqWG9fqSgT0VbHhzp8bHbFux5mvlgz1gUkEaQ=
18-
golang.org/x/tools v0.0.0-20190925211824-e4ea94538f5b/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
17+
golang.org/x/tools v0.0.0-20191018203202-04252eccb9d5 h1:TFUhCYbgGMOGnRxJv+j0iAcxCjk8oGjXXWNejQBhUUs=
18+
golang.org/x/tools v0.0.0-20191018203202-04252eccb9d5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
1919
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
2020
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=

src/cmd/vendor/golang.org/x/tools/go/analysis/passes/asmdecl/asmdecl.go

-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/vendor/golang.org/x/tools/go/analysis/validate.go

-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/vendor/modules.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ golang.org/x/crypto/ssh/terminal
3131
## explicit
3232
golang.org/x/sys/unix
3333
golang.org/x/sys/windows
34-
# golang.org/x/tools v0.0.0-20190925211824-e4ea94538f5b
34+
# golang.org/x/tools v0.0.0-20191018203202-04252eccb9d5
3535
## explicit
3636
golang.org/x/tools/go/analysis
3737
golang.org/x/tools/go/analysis/internal/analysisflags

src/cmd/vet/testdata/print/print.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ func PrintfTests() {
8181
fmt.Printf("%T %T", 3, i)
8282
fmt.Printf("%U %U", 3, i)
8383
fmt.Printf("%v %v", 3, i)
84-
fmt.Printf("%x %x %x %x", 3, i, "hi", s)
85-
fmt.Printf("%X %X %X %X", 3, i, "hi", s)
84+
fmt.Printf("%x %x %x %x %x %x %x", 3, i, "hi", s, x, c, fslice)
85+
fmt.Printf("%X %X %X %X %X %X %X", 3, i, "hi", s, x, c, fslice)
8686
fmt.Printf("%.*s %d %g", 3, "hi", 23, 2.3)
8787
fmt.Printf("%s", &stringerv)
8888
fmt.Printf("%v", &stringerv)
@@ -125,7 +125,6 @@ func PrintfTests() {
125125
fmt.Printf("%t", 23) // ERROR "Printf format %t has arg 23 of wrong type int"
126126
fmt.Printf("%U", x) // ERROR "Printf format %U has arg x of wrong type float64"
127127
fmt.Printf("%x", nil) // ERROR "Printf format %x has arg nil of wrong type untyped nil"
128-
fmt.Printf("%X", 2.3) // ERROR "Printf format %X has arg 2.3 of wrong type float64"
129128
fmt.Printf("%s", stringerv) // ERROR "Printf format %s has arg stringerv of wrong type .*print.ptrStringer"
130129
fmt.Printf("%t", stringerv) // ERROR "Printf format %t has arg stringerv of wrong type .*print.ptrStringer"
131130
fmt.Printf("%s", embeddedStringerv) // ERROR "Printf format %s has arg embeddedStringerv of wrong type .*print.embeddedStringer"

0 commit comments

Comments
 (0)