Select
The select
statement lets a goroutine wait on multiple communication operations.
A select
blocks until one of its cases can run, then it executes that case. It chooses one at random if multiple are ready.
Example
Default Selection
The default
case in a select
is run if no other case is ready.
Example
Last updated