Also mention another restriction of receive-only channels
This commit is contained in:
parent
58e66a8103
commit
d21dedf4b9
@ -19,6 +19,10 @@ func ping(pings chan<- string, msg string) {
|
|||||||
func pong(pings <-chan string, pongs chan<- string) {
|
func pong(pings <-chan string, pongs chan<- string) {
|
||||||
msg := <-pings
|
msg := <-pings
|
||||||
pongs <- msg
|
pongs <- msg
|
||||||
|
|
||||||
|
// it is a compile-time error to close
|
||||||
|
// the receive-only channel `pings`.
|
||||||
|
// close(pings)
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user