1
0
mirror of https://github.com/golang/go synced 2024-07-08 12:18:55 +00:00

doc: document cmd/vet changes for 1.18 release

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>
This commit is contained in:
Tim King 2021-12-09 11:06:25 -08:00
parent c473ca0877
commit 766f89b5c6

View 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 -->