]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.13] cmd: update golang.org/x/tools to v0.0.0-20200615191743-991d5...
authorDmitri Shuralyov <dmitshur@golang.org>
Mon, 15 Jun 2020 19:23:04 +0000 (15:23 -0400)
committerDmitri Shuralyov <dmitshur@golang.org>
Mon, 15 Jun 2020 22:36:22 +0000 (22:36 +0000)
This teaches vet to recognize the new formats %#b and %O on integers,
%x on float/complex. They have been supported since the 1.13 release,
but vet would warn about it.

Also update cmd/vet testdata accordingly, as was done in CL 202083.

Fixes #39287.
For #29986.

Change-Id: Ia7817ee60ae6beac32cc402c0c68afa917e4ef0f
Reviewed-on: https://go-review.googlesource.com/c/go/+/238018
Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go.mod
src/cmd/go.sum
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go
src/cmd/vendor/modules.txt
src/cmd/vet/testdata/print/print.go

index 19496a3c6719c10bcb4e8f3e912fc299178fc7f7..05d995f473c8252697ec5d2a8e875305307b6e41 100644 (file)
@@ -8,5 +8,5 @@ require (
        golang.org/x/arch v0.0.0-20190815191158-8a70ba74b3a1
        golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c
        golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 // indirect
-       golang.org/x/tools v0.0.0-20190611154301-25a4f137592f
+       golang.org/x/tools v0.0.0-20200615191743-991d59a616de
 )
index 9aa94eee7b3a21c355422e5b33e3d1752d1a40bb..44c1ac8d39713395677ce83961161da5e876dd01 100644 (file)
@@ -15,6 +15,6 @@ golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 h1:vsphBvatvfbhlb4PO1BYSr9dz
 golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/tools v0.0.0-20190611154301-25a4f137592f h1:6awn5JC4pwVI5HiBqs7MDtRxnwV9PpO5iSA9v6P09pA=
-golang.org/x/tools v0.0.0-20190611154301-25a4f137592f/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20200615191743-991d59a616de h1:kFKSx8iHlOzmtGWtfJW+b2UzcJ+rMWHHyUBpjrZq8To=
+golang.org/x/tools v0.0.0-20200615191743-991d59a616de/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
 rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
index f59e95dc219f2ac602216fb8e542bb7e4bc6afc1..5f9f771a6249db59a8246b22a094d859af39dc00 100644 (file)
@@ -722,7 +722,7 @@ var printVerbs = []printVerb{
        // '#' is alternate format for several verbs.
        // ' ' is spacer for numbers
        {'%', noFlag, 0},
-       {'b', numFlag, argInt | argFloat | argComplex | argPointer},
+       {'b', sharpNumFlag, argInt | argFloat | argComplex | argPointer},
        {'c', "-", argRune | argInt},
        {'d', numFlag, argInt | argPointer},
        {'e', sharpNumFlag, argFloat | argComplex},
@@ -732,6 +732,7 @@ var printVerbs = []printVerb{
        {'g', sharpNumFlag, argFloat | argComplex},
        {'G', sharpNumFlag, argFloat | argComplex},
        {'o', sharpNumFlag, argInt | argPointer},
+       {'O', sharpNumFlag, argInt | argPointer},
        {'p', "-#", argPointer},
        {'q', " -+.0#", argRune | argInt | argString},
        {'s', " -+.0", argString},
@@ -740,8 +741,8 @@ var printVerbs = []printVerb{
        {'U', "-#", argRune | argInt},
        {'v', allFlags, anyType},
        {'w', noFlag, anyType},
-       {'x', sharpNumFlag, argRune | argInt | argString | argPointer},
-       {'X', sharpNumFlag, argRune | argInt | argString | argPointer},
+       {'x', sharpNumFlag, argRune | argInt | argString | argPointer | argFloat | argComplex},
+       {'X', sharpNumFlag, argRune | argInt | argString | argPointer | argFloat | argComplex},
 }
 
 // okPrintfArg compares the formatState to the arguments actually present,
index e873ad44555d5733ef33f038eb52230ba70d340f..8c3ed65b3ae70a2e91c093e1a82577acfdad6874 100644 (file)
@@ -26,7 +26,7 @@ golang.org/x/crypto/ssh/terminal
 # golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82
 golang.org/x/sys/unix
 golang.org/x/sys/windows
-# golang.org/x/tools v0.0.0-20190611154301-25a4f137592f
+# golang.org/x/tools v0.0.0-20200615191743-991d59a616de
 golang.org/x/tools/go/analysis
 golang.org/x/tools/go/analysis/internal/analysisflags
 golang.org/x/tools/go/analysis/internal/facts
index 7a4783aee4fd920c6c90b7e3a8dcce1a254522cb..fca594925f7a8a4c0828d871ddec9496d905ec16 100644 (file)
@@ -81,8 +81,8 @@ func PrintfTests() {
        fmt.Printf("%T %T", 3, i)
        fmt.Printf("%U %U", 3, i)
        fmt.Printf("%v %v", 3, i)
-       fmt.Printf("%x %x %x %x", 3, i, "hi", s)
-       fmt.Printf("%X %X %X %X", 3, i, "hi", s)
+       fmt.Printf("%x %x %x %x %x %x %x", 3, i, "hi", s, x, c, fslice)
+       fmt.Printf("%X %X %X %X %X %X %X", 3, i, "hi", s, x, c, fslice)
        fmt.Printf("%.*s %d %g", 3, "hi", 23, 2.3)
        fmt.Printf("%s", &stringerv)
        fmt.Printf("%v", &stringerv)
@@ -125,7 +125,6 @@ func PrintfTests() {
        fmt.Printf("%t", 23)                        // ERROR "Printf format %t has arg 23 of wrong type int"
        fmt.Printf("%U", x)                         // ERROR "Printf format %U has arg x of wrong type float64"
        fmt.Printf("%x", nil)                       // ERROR "Printf format %x has arg nil of wrong type untyped nil"
-       fmt.Printf("%X", 2.3)                       // ERROR "Printf format %X has arg 2.3 of wrong type float64"
        fmt.Printf("%s", stringerv)                 // ERROR "Printf format %s has arg stringerv of wrong type .*print.ptrStringer"
        fmt.Printf("%t", stringerv)                 // ERROR "Printf format %t has arg stringerv of wrong type .*print.ptrStringer"
        fmt.Printf("%s", embeddedStringerv)         // ERROR "Printf format %s has arg embeddedStringerv of wrong type .*print.embeddedStringer"