|
|
|
|
|
by scriptkiddy
3310 days ago
|
|
So, keep in mind that my experience with Go is not at a professional level. Take this example: https://gobyexample.com/channel-buffering As far as my understanding is concerned, channels are a way for goroutines to pass data between one another, correct? Yet in this particular case, the channel `messages` is operating in the same manner as a generator or array. So, am I creating goroutines by passing messages to the channel or am I just using the channel as a simple buffer? This example helps as well: https://gobyexample.com/channel-directions Am I implicitly creating goroutines by using channels or am I simply creating a buffer? Sorry I don't have any of my own code to share as I deleted all of my Go practice stuff. |
|
The flow of data through channels can be confusing until the concept becomes familiar, but the behavior is well-defined, so the behavior is as easy or difficult to predict as of any program of the given complexity.