aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bonventre <andybons@golang.org>2018-08-09 19:43:54 -0400
committerAndrew Bonventre <andybons@golang.org>2018-08-09 23:56:40 +0000
commit89e13c80efe19caa7deb8e4a5b0ccfa385a8b0bf (patch)
tree0a5cea7cf1705082465a58843927e24ef5cd028d
parenta0127c1921fdba2b4384d599407a3eedfe547803 (diff)
downloadgo-89e13c80efe19caa7deb8e4a5b0ccfa385a8b0bf.tar.gz
go-89e13c80efe19caa7deb8e4a5b0ccfa385a8b0bf.zip
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/128902 Reviewed-by: Russ Cox <rsc@golang.org>
-rw-r--r--doc/go1.11.html16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/go1.11.html b/doc/go1.11.html
index e76e21c52e..a1249db475 100644
--- a/doc/go1.11.html
+++ b/doc/go1.11.html
@@ -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 -->