diff --git a/doc/go1.22.html b/doc/go1.22.html index 951a8e316001d4..5aa0a3f54dc952 100644 --- a/doc/go1.22.html +++ b/doc/go1.22.html @@ -136,9 +136,20 @@
+ The behavior of the vet
tool has changed to match
+ the new semantics (see above) of loop variables in Go 1.22.
+ When analyzing a file that requires Go 1.22 or newer
+ (due to its go.mod file or a per-file build constraint),
+ vet
code> no longer reports references to
+ loop variables from within a function literal that
+ might outlive the iteration of the loop.
+ In Go 1.22, loop variables are created anew for each iteration,
+ so such references are no longer at risk of using a variable
+ after it has been updated by the loop.
+