2 ms·
Personally, I never read or write a channel without some sort of time bound, so this behavior doesn't really bother me: select { case foo := <-whatever
by jrockway 6y ago
Personally, I never read or write a channel without some sort of time bound, so this behavior doesn't really bother me:
select {
case foo := <-whateverCh:
log.Printf("hey a foo: %v", foo)
case <-ctx.Done():
log.Println("the user doesn't care about the answer anymore, so let's not leak the goroutine")
}