diff --git a/doc/go1.18.html b/doc/go1.18.html index 61bb8dbbcb..5f94aa86c4 100644 --- a/doc/go1.18.html +++ b/doc/go1.18.html @@ -29,6 +29,20 @@ Do not send CLs removing the interior tags from such phrases. TODO: complete this section
+
+ The Go 1.18 compiler now correctly reports declared but not used errors
+ for variables that are set inside a function literal but are never used. Before Go 1.18,
+ the compiler did not report an error in such cases. This fixes long-outstanding compiler
+ issue #8560. As a result of this change,
+ (possibly incorrect) programs may not compile anymore. The necessary fix is
+ straightforward: fix the program if it was in fact incorrect, or use the offending
+ variable, for instance by assigning it to the blank identifier _.
+ Since go vet always pointed out this error, the number of affected
+ programs is likely very small.
+