]> Cypherpunks repositories - gostls13.git/commitdiff
builtin: correct description of a closed channel.
authorRob Pike <r@golang.org>
Tue, 16 Aug 2011 06:03:30 +0000 (16:03 +1000)
committerRob Pike <r@golang.org>
Tue, 16 Aug 2011 06:03:30 +0000 (16:03 +1000)
R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/4896046

src/pkg/builtin/builtin.go

index f835580de8576382db7e8477efeba0d9ac5723c7..07acce4f7007ae823aa8c26be6be4733988d9c23 100644 (file)
@@ -104,10 +104,10 @@ func imag(c ComplexType) FloatType
 // bidirectional or send-only. It should be executed only by the sender,
 // never the receiver, and has the effect of shutting down the channel after
 // the last sent value is received. After the last value has been received
-// from a closed channel c,
+// from a closed channel c, any receive from c will succeed without
+// blocking, returning the zero value for the channel element. The form
 //     x, ok := <-c
-// will set x to the channel element's zero value and ok to false, and select
-// clauses involving c will never execute.
+// will also set ok to false for a closed channel.
 func close(c chan<- Type)
 
 // The panic built-in function stops normal execution of the current