This commit is contained in:
Mark McGranaghan 2012-10-18 07:26:08 -07:00
parent b044506449
commit e6a3c56d77
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
// When using channels as function parameters, you can
// specify if a channel is meant to only send or receive
// values. This specificity further increases the
// type-safety of the program.
// values. This specificity increases the type-safety of
// the program.
package main
@ -15,7 +15,7 @@ func ping(pings chan<- string, msg string) {
}
// The `pong` function accepts one channel for receives
// (`pings`) and a second for sends (`pongs`)
// (`pings`) and a second for sends (`pongs`).
func pong(pings <-chan string, pongs chan<- string) {
msg := <-pings
pongs <- msg