diff --git a/doc/go_spec.html b/doc/go_spec.html index cf31cd30639..f33147a4453 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -3249,8 +3249,9 @@ will cause a run-time panic.
For an operand
A send statement sends a value on a channel.
-The channel expression must be of channel type
-and the type of the value must be assignable
+The channel expression must be of channel type,
+the channel direction must permit send operations,
+and the type of the value to be sent must be assignable
to the channel's element type.
The expression on the right in the "range" clause is called the range expression,
-which may be an array, pointer to an array, slice, string, map, or channel.
+which may be an array, pointer to an array, slice, string, map, or channel permitting
+receive operations.
As with an assignment, the operands on the left must be
addressable or map index expressions; they
denote the iteration variables. If the range expression is a channel, only
-one iteration variable is permitted, otherwise there may be one or two.
-If the second iteration variable is the blank identifier,
+one iteration variable is permitted, otherwise there may be one or two. In the latter case,
+if the second iteration variable is the blank identifier,
the range clause is equivalent to the same clause with only the first variable present.
ch
of channel type,
the value of the receive operation <-ch
is the value received
-from the channel ch
. The type of the value is the element type of
-the channel. The expression blocks until a value is available.
+from the channel ch
. The channel direction must permit receive operations,
+and the type of the receive operation is the element type of the channel.
+The expression blocks until a value is available.
Receiving from a nil
channel blocks forever.
Receiving from a closed channel always succeeds,
immediately returning the element type's zero
@@ -3873,8 +3874,9 @@ len("foo") // illegal if len is the built-in function