mirror of
https://github.com/golang/go
synced 2024-11-22 04:14:42 -07:00
spec: better wording re: receiving from closed channels
As suggested by ej@evanjones.ca. Fixes #5604. R=r CC=golang-dev https://golang.org/cl/9899043
This commit is contained in:
parent
787976c739
commit
ab5c762a46
@ -1,6 +1,6 @@
|
||||
<!--{
|
||||
"Title": "The Go Programming Language Specification",
|
||||
"Subtitle": "Version of May 20, 2013",
|
||||
"Subtitle": "Version of May 31, 2013",
|
||||
"Path": "/ref/spec"
|
||||
}-->
|
||||
|
||||
@ -3301,9 +3301,8 @@ from the channel <code>ch</code>. The channel direction must permit receive oper
|
||||
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 <code>nil</code> channel blocks forever.
|
||||
Receiving from a <a href="#Close">closed</a> channel always succeeds,
|
||||
immediately returning the element type's <a href="#The_zero_value">zero
|
||||
value</a>.
|
||||
A receive operation on a <a href="#Close">closed</a> channel can always proceed
|
||||
immediately, yielding the element type's <a href="#The_zero_value">zero value</a>.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
|
Loading…
Reference in New Issue
Block a user