Skip to content

Commit 77cc7fb

Browse files
thepuddsgopherbot
authored andcommitted
doc/next: add motivation and details links for range-over-func iterators
The "Changes to the language" section at the top of the release notes will likely ultimately include more explanation about iterators, or at least, the Go project will likely publish additional introductory material on iterators on the blog and so on. As a perhaps temporary step given current interest, this CL updates the release notes with two additional links for details and motivation. The new package documentation for the iter package is up-to-date, precise, and also more accessible than the language spec, while the 2022 pre-proposal GitHub discussion starts with perhaps the most compelling motivation writeup so far. (We purposefully include "2022" in the text to help illustrate this was not the result of an overly hasty process). We also update the target of the existing language spec reference to be closer to the new material. For #61405. Change-Id: I4bc0f99c40f31edfc5c0e635dca5f844b26b6eeb Reviewed-on: https://go-review.googlesource.com/c/go/+/592935 Reviewed-by: Mauri de Souza Meneguzzo <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 144c96f commit 77cc7fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

doc/next/2-language.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ The "range" clause in a "for-range" loop now accepts iterator functions of the f
1010

1111
as range expressions.
1212
Calls of the iterator argument function produce the iteration values for the "for-range" loop.
13-
For details see the [language spec](/ref/spec#For_statements).
13+
For details see the [iter] package documentation and the [language spec](/ref/spec#For_range).
14+
For motivation see the 2022 ["range-over-func" discussion](/issue/56413).
1415

1516
<!-- go.dev/issue/46477, CL 566856, CL 586955, CL 586956 -->
1617
Go 1.23 includes preview support for [generic type aliases](/issue/46477).

0 commit comments

Comments
 (0)