Skip to content

Commit 1b07b77

Browse files
griesemerRobert Griesemer
authored and
Robert Griesemer
committed
doc: document "range-over-func" language change in release notes
For golang#65614. Change-Id: Idbbcb6eb57b7294d52b174c1aba74ca7aa1b8efd Reviewed-on: https://go-review.googlesource.com/c/go/+/590616 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> TryBot-Bypass: Robert Griesemer <[email protected]>
1 parent 1033172 commit 1b07b77

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/next/2-language.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
## Changes to the language {#language}
22

3+
<!-- go.dev/issue/61405, CL 557835, CL 584596 -->
4+
Go 1.23 makes the (Go 1.22) ["range-over-func" experiment](https://tip.golang.org/wiki/RangefuncExperiment) a part of the language.
5+
The "range" clause in a "for-range" loop now accepts iterator functions of the following types
36

7+
func(func() bool)
8+
func(func(K) bool)
9+
func(func(K, V) bool)
10+
11+
as range expressions.
12+
Calls of the iterator argument function produce the iteration values for the "for-range" loop.
13+
For details see the [language spec](https://tip.golang.org/ref/spec#For_statements).

0 commit comments

Comments
 (0)