From f41fdc126786ced31e58649d2a1f5ec8da13c439 Mon Sep 17 00:00:00 2001 From: Robert Findley Date: Tue, 15 Nov 2022 11:30:55 -0500 Subject: [PATCH] doc/go1.20: document changes to the loopclosure vet analysis Address the release notes TODO regarding the loopclosure analyzer, documenting the new warning for parallel subtests. In doing so, choose a structure for the vet section, opting for h4 headings. In recent years, we have used either h4 headings or simple paragraphs to document vet changes. This year, I thought it worthwhile to put the timeformat and loopclosure changes into separate sections. Also document the improvements to reference capture detection introduced in CL 452615. Change-Id: I05886f7025d66bb7f2609f787f69d1a769ca6f5e Reviewed-on: https://go-review.googlesource.com/c/go/+/450735 Run-TryBot: Robert Findley Reviewed-by: Tim King Reviewed-by: Alan Donovan TryBot-Result: Gopher Robot --- doc/go1.20.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/doc/go1.20.html b/doc/go1.20.html index aaa811e595..4ffb5a457f 100644 --- a/doc/go1.20.html +++ b/doc/go1.20.html @@ -182,12 +182,26 @@ Do not send CLs removing the interior tags from such phrases.

Vet

+

New diagnostic for incorrect time formats

+

TODO: https://go.dev/issue/48801: check for time formats with 2006-02-01

+

Improved detection of loop variable capture by nested functions

+

- TODO: https://go.dev/issue/55972: extend the loopclosure analysis to parallel subtests + The vet tool now reports references to loop variables following + a call to T.Parallel() + within subtest function bodies. Such references may observe the value of the + variable from a different iteration (typically causing test cases to be + skipped) or an invalid state due to unsynchronized concurrent access. +

+ +

+ The tool also detects reference mistakes in more places. Previously it would + only consider the last statement of the loop body, but now it recursively + inspects the last statements within if, switch, and select statements.

Runtime

-- 2.50.0