]> Cypherpunks repositories - gostls13.git/commitdiff
doc: document cmd/vet changes for 1.18 release
authorTim King <taking@google.com>
Thu, 9 Dec 2021 19:06:25 +0000 (11:06 -0800)
committerTim King <taking@google.com>
Fri, 10 Dec 2021 19:26:50 +0000 (19:26 +0000)
cmd/vet has several precision improvements for the checkers copylock, printf, sortslice, testinggoroutine, and tests. Adds a high level mention in the release notes and an example of string constant concatenation.

Updates #47694

Change-Id: I7a342a57ca3fd9e2f3e8ec99f7b647269798317f
Reviewed-on: https://go-review.googlesource.com/c/go/+/370734
Reviewed-by: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Trust: Tim King <taking@google.com>
Run-TryBot: Tim King <taking@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

doc/go1.18.html

index 8142a93b7b6f37d57ec021c169ae0087a680c913..67af3e6a904e886046ad31520d1dea58cd5e15c8 100644 (file)
@@ -288,6 +288,21 @@ Do not send CLs removing the interior tags from such phrases.
 }</pre>
 </p>
 
+<h4 id="vet-precision">Precision improvements for existing checkers</h4>
+
+<p><!-- CL 323589 356830 319689 355730 351553 338529 -->
+  The <code>cmd/vet</code> checkers <code>copylock</code>, <code>printf</code>,
+  <code>sortslice</code>, <code>testinggoroutine</code>, and <code>tests</code>
+  have all had moderate precision improvements to handle additional code patterns.
+  This may lead to newly reported errors in existing packages. For example, the
+  <code>printf</code> checker now tracks formatting strings created by
+  concatenating string constants. So <code>vet</code> will report an error in:
+<pre>
+  // fmt.Printf formatting directive %d is being passed to Println.
+  fmt.Println("%d"+` ≡ x (mod 2)`+"\n", x%2)
+</pre>
+</p>
+
 <h2 id="runtime">Runtime</h2>
 
 <p><!-- https://golang.org/issue/44167 -->