diff --git a/doc/go_spec.html b/doc/go_spec.html index c1d3360ef6..b5b7f15bbd 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -6620,7 +6620,8 @@ In that case, the example above prints

A "for" statement with a "range" clause iterates through all entries of an array, slice, string or map, values received on -a channel, or integer values from zero to an upper limit [Go 1.22]. +a channel, integer values from zero to an upper limit [Go 1.22], +or values passed to an iterator function's yield function [Go 1.23]. For each entry it assigns iteration values to corresponding iteration variables if present and then executes the block.

@@ -6633,11 +6634,15 @@ RangeClause = [ ExpressionList "=" | IdentifierList ":=" ] "range" Expression . The expression on the right in the "range" clause is called the range expression, its core type must be an array, pointer to an array, slice, string, map, channel permitting -receive operations, or an integer. +receive operations, an integer, or +a function with specific signature (see below). As with an assignment, if present the operands on the left must be addressable or map index expressions; they -denote the iteration variables. If the range expression is a channel or integer, -at most one iteration variable is permitted, otherwise there may be up to two. +denote the iteration variables. +If the range expression is a function, the maximum number of iteration variables depends on +the function signature. +If the range expression is a channel or integer, at most one iteration variable is permitted; +otherwise there may be up to two. If the last iteration variable is the blank identifier, the range clause is equivalent to the same clause without that identifier.

@@ -8676,6 +8681,12 @@ integer values from zero to an upper limit. +

Go 1.23

+

Type unification rules