Open celrenheit opened 1 year ago
Do you have an example where this actually happened?
I came across twice on an existing code doing:
select {
case <-ctx.Done():
// ...
default:
ch <- 1
}
instead of
select {
case <-ctx.Done():
// ...
case ch <- 1:
}
This caused a deadlock blocking the exit.
I wasn't sure to open a PR for this, after using it to look for other issues like that, because it might raise false positives.
catch potential deadlock when the context is done but waiting to send on a channel in the default case