From: Tim King
Date: Thu, 9 Dec 2021 19:06:25 +0000 (-0800)
Subject: doc: document cmd/vet changes for 1.18 release
X-Git-Tag: go1.18beta1~28
X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=766f89b5c625f8c57492cf5645576d9e6f450cc2;p=gostls13.git
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
Reviewed-by: Robert Findley
Trust: Tim King
Run-TryBot: Tim King
TryBot-Result: Gopher Robot
---
diff --git a/doc/go1.18.html b/doc/go1.18.html
index 8142a93b7b..67af3e6a90 100644
--- a/doc/go1.18.html
+++ b/doc/go1.18.html
@@ -288,6 +288,21 @@ Do not send CLs removing the interior tags from such phrases.
}
+Precision improvements for existing checkers
+
+
+ The cmd/vet
checkers copylock
, printf
,
+ sortslice
, testinggoroutine
, and tests
+ have all had moderate precision improvements to handle additional code patterns.
+ This may lead to newly reported errors in existing packages. For example, the
+ printf
checker now tracks formatting strings created by
+ concatenating string constants. So vet
will report an error in:
+
+ // fmt.Printf formatting directive %d is being passed to Println.
+ fmt.Println("%d"+` â¡ x (mod 2)`+"\n", x%2)
+
+
+
Runtime