Channels in Go
Intro A go maxim or proverb is:
Do not communicate by sharing memory; instead, share memory by communicating.
So what is a channel?
A channel is a “typed” conduit (pipes) mechanism for goroutines to synchronize execution and communicate by passing values, using channel operator, <-. They are mechanism for communication between goroutines.
Syntax // can only be used to send float64s chan<- float64 // can only be used to receive ints <-chan int // can be used to send and receive values of type Dosa chan Dosa (The data flows in the direction of the arrow.
[Read More]