From fe1b2f95e6dbfb6e6212bb391706ae62eb0ae5ec Mon Sep 17 00:00:00 2001
From: David Chase
- TODO: complete this section
+
+Go 1.22 makes two changes to "for" loops.
+Changes to the language
+
+
+
+
+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.