]> Cypherpunks repositories - gostls13.git/commitdiff
doc: document "range-over-func" language change in release notes
authorRobert Griesemer <gri@golang.org>
Tue, 4 Jun 2024 23:06:12 +0000 (16:06 -0700)
committerRobert Griesemer <gri@google.com>
Tue, 4 Jun 2024 23:33:52 +0000 (23:33 +0000)
For #65614.

Change-Id: Idbbcb6eb57b7294d52b174c1aba74ca7aa1b8efd
Reviewed-on: https://go-review.googlesource.com/c/go/+/590616
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
TryBot-Bypass: Robert Griesemer <gri@google.com>

doc/next/2-language.md

index 61030bd67606b037e083f01d21daed91c36f43b9..e45874b95437cd813574d3d103c768eeb8b3b3e9 100644 (file)
@@ -1,3 +1,13 @@
 ## Changes to the language {#language}
 
+<!-- go.dev/issue/61405, CL 557835, CL 584596 -->
+Go 1.23 makes the (Go 1.22) ["range-over-func" experiment](https://tip.golang.org/wiki/RangefuncExperiment) a part of the language.
+The "range" clause in a "for-range" loop now accepts iterator functions of the following types
 
+        func(func() bool)
+        func(func(K) bool)
+        func(func(K, V) bool)
+
+ as range expressions.
+ Calls of the iterator argument function produce the iteration values for the "for-range" loop.
+ For details see the [language spec](https://tip.golang.org/ref/spec#For_statements).