Go - What is the equivalent of Python's "pass"?
The default
case in a select
statement is intended to provide non-blocking I/O for channel reads and writes. The code in the default
case is executed whenever none of the channels in any of the cases are ready to be read/written to.
So in your case, the default
block is executed if the quit channel has nothing to say.
You can simply remove the default case and it will block on the quit_status := <-quit
case until a value is available in quit
.. which is probably what you are after in this instance.
If you want to immediately continue executing code after the select statement, you should run this select statement in a separate goroutine:
go func() {
select {
case quit_status := <-quit:
...
}
}()
// Execution continues here immediately.