Commit 86aad668 authored by David Symonds's avatar David Symonds

cmd/vet: %#q is a valid format (uses raw quotes).

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7057051
parent a091d2e6
...@@ -208,7 +208,7 @@ var printVerbs = []printVerb{ ...@@ -208,7 +208,7 @@ var printVerbs = []printVerb{
{'G', numFlag}, {'G', numFlag},
{'o', sharpNumFlag}, {'o', sharpNumFlag},
{'p', "-#"}, {'p', "-#"},
{'q', " -+.0"}, {'q', " -+.0#"},
{'s', " -+.0"}, {'s', " -+.0"},
{'t', "-"}, {'t', "-"},
{'T', "-"}, {'T', "-"},
...@@ -287,6 +287,7 @@ func BadFunctionUsedInTests() { ...@@ -287,6 +287,7 @@ func BadFunctionUsedInTests() {
fmt.Printf("%.*d", 3, 3) // correct fmt.Printf("%.*d", 3, 3) // correct
fmt.Printf("%.*d", 3, 3, 3) // ERROR "wrong number of args in Printf call" fmt.Printf("%.*d", 3, 3, 3) // ERROR "wrong number of args in Printf call"
fmt.Printf("%q %q", multi()...) // ok fmt.Printf("%q %q", multi()...) // ok
fmt.Printf("%#q", `blah`) // ok
printf("now is the time", "buddy") // ERROR "no formatting directive" printf("now is the time", "buddy") // ERROR "no formatting directive"
Printf("now is the time", "buddy") // ERROR "no formatting directive" Printf("now is the time", "buddy") // ERROR "no formatting directive"
Printf("hi") // ok Printf("hi") // ok
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment