Also mention another restriction of receive-only channels

This commit is contained in:
Josh Leverette 2021-06-09 19:30:44 -04:00 committed by GitHub
parent 58e66a8103
commit d21dedf4b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,6 +19,10 @@ func ping(pings chan<- string, msg string) {
func pong(pings <-chan string, pongs chan<- string) {
msg := <-pings
pongs <- msg
// it is a compile-time error to close
// the receive-only channel `pings`.
// close(pings)
}
func main() {