diff --git a/doc/go1.22.html b/doc/go1.22.html index c87d9d3b21..7e2b4da20c 100644 --- a/doc/go1.22.html +++ b/doc/go1.22.html @@ -26,7 +26,39 @@ Do not send CLs removing the interior tags from such phrases.
- TODO: complete this section + +Go 1.22 makes two changes to "for" loops. +
+package main
+
+import "fmt"
+
+func main() {
+ for i := range 10 {
+ fmt.Println(10 - i)
+ }
+ fmt.Println("go1.22 has lift-off!")
+}
+
+ See the spec for details.
+
+ Go 1.22 includes a preview of a language change we are considering
+ for a future version of Go: range-over-function iterators.
+ Building with GOEXPERIMENT=rangefunc enables this feature.