Fork me on GitHub

noob question: I am using a channel in clojurescript. a normal/parked go-loop reads from the channel. when the channel is closed, I expect to see a final nil value in the take but I see nothing. I’m worried that this will be a memory leak. Am I wrong to expect a final nil value when a channel is closed?


you're right to expect a nil value, but that doesn't necessarily imply a memory leak


channels don't need to be closed to be garbage collected


that’s reassuring, thanks. it still leaves me wondering why I don’t see a nil. the docs clearly state a nil will be on the channel upon close!.


on closer inspection I suspect I have a bug : noob mistake!


it's never nil published to the channel - if a channel is closed every read gets a nil immediately on read