mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-30 14:58:04 +03:00
chan chan string -> channel of string channels
This commit is contained in:
parent
412b312c45
commit
abb903caba
@ -251,7 +251,7 @@ func learnConcurrency() {
|
|||||||
fmt.Println(<-c, <-c, <-c) // channel on right, <- is "receive" operator.
|
fmt.Println(<-c, <-c, <-c) // channel on right, <- is "receive" operator.
|
||||||
|
|
||||||
cs := make(chan string) // another channel, this one handles strings.
|
cs := make(chan string) // another channel, this one handles strings.
|
||||||
cc := make(chan chan string) // a channel of channels.
|
cc := make(chan chan string) // a channel of string channels.
|
||||||
go func() { c <- 84 }() // start a new goroutine just to send a value
|
go func() { c <- 84 }() // start a new goroutine just to send a value
|
||||||
go func() { cs <- "wordy" }() // again, for cs this time
|
go func() { cs <- "wordy" }() // again, for cs this time
|
||||||
// Select has syntax like a switch statement but each case involves
|
// Select has syntax like a switch statement but each case involves
|
||||||
|
Loading…
Reference in New Issue
Block a user