4 ms·
> I still run into deadlocks and panics (writing to a closed channel) when I try to use channels beyond the simplest use cases. Wild! The rule is that channel
by sagichmal 5y ago
> I still run into deadlocks and panics (writing to a closed channel) when I try to use channels beyond the simplest use cases.
Wild!
The rule is that channels are owned by a single goroutine, who's uniquely responsible for sending on them, and closing them. That's basically it. Do that and everything works fine, in my experience.