News for hackers. Stuff that matters.
Re:Golang: Know Your 'Nil' by jrockway on Tuesday March 30, 2021 @02:14PM (#26638179)
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")
    }

There are no comments on this comment yet.