Commit 89e13c80 authored by Andrew Bonventre's avatar Andrew Bonventre

doc/go1.11: add note about vet checks for printf wrappers

Fixes golang/go#26372

Change-Id: I30716ba56f829c6e36ccd50471e118084bad7360
Reviewed-on: https://go-review.googlesource.com/128902Reviewed-by: default avatarRuss Cox <rsc@golang.org>
parent a0127c19
......@@ -299,6 +299,22 @@ func f(v interface{}) {
a warning to be printed, and <code>vet</code> to exit with status 1.
</p>
<p><!-- CL 108559 -->
Additionally, <a href="/cmd/vet"><code>go</code>&nbsp;<code>vet</code></a>
has become more robust when format-checking <code>printf</code> wrappers.
Vet now detects the mistake in this example:
</p>
<pre>
func wrapper(s string, args ...interface{}) {
fmt.Printf(s, args...)
}
func main() {
wrapper("%s", 42)
}
</pre>
<h3 id="trace">Trace</h3>
<p><!-- CL 63274 -->
......
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