1
0
mirror of https://github.com/golang/go synced 2024-11-18 19:44:46 -07:00

go/analysis/passes/printf: add support for %w

Change-Id: I91bd2a1f3f65f95258fa5a5b91aca51ff0885bad
Reviewed-on: https://go-review.googlesource.com/c/162058
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
This commit is contained in:
Marcel van Lohuizen 2019-02-12 23:22:36 +04:00
parent 0e66cc6fab
commit 6bedcd1097
2 changed files with 3 additions and 0 deletions

View File

@ -731,6 +731,7 @@ var printVerbs = []printVerb{
{'T', "-", anyType},
{'U', "-#", argRune | argInt},
{'v', allFlags, anyType},
{'w', noFlag, anyType},
{'x', sharpNumFlag, argRune | argInt | argString | argPointer},
{'X', sharpNumFlag, argRune | argInt | argString | argPointer},
}

View File

@ -63,6 +63,7 @@ func PrintfTests() {
var imap map[int]int
var fslice []float64
var c complex64
var err error
// Some good format/argtypes
fmt.Printf("")
fmt.Printf("%b %b %b", 3, i, x)
@ -96,6 +97,7 @@ func PrintfTests() {
fmt.Printf("%T", notstringerv)
fmt.Printf("%q", stringerarrayv)
fmt.Printf("%v", stringerarrayv)
fmt.Printf("%w", err)
fmt.Printf("%s", stringerarrayv)
fmt.Printf("%v", notstringerarrayv)
fmt.Printf("%T", notstringerarrayv)