![]() |
VOOZH | about |
|
Channels are the pipes that connect concurrent goroutines. You can send values into channels from one goroutine and receive those values into another goroutine. |
|
|
👁 Run code 👁 Copy code
|
|
|
|
|
|
|
Create a new channel with |
|
|
Send a value into a channel using the |
|
|
The |
|
|
When we run the program the |
|
|
By default sends and receives block until both the
sender and receiver are ready. This property allowed
us to wait at the end of our program for the |
Next example: Channel Buffering.
by Mark McGranaghan and Eli Bendersky | source | license