4 ms·
That's not at all what I was referring to. It's not merely having channels as function arguments. Channels broadly have footguns around how closed and nil cha
by treyd 3y ago
That's not at all what I was referring to. It's not merely having channels as function arguments. Channels broadly have footguns around how closed and nil channels are treated and you can run into work contention/starvation issues accidentally, since they do have their own throughput limits. And wrapping them in your own handle types that's specific to the library's use case allows you to deal with those issues and swap out the implementation of the cross-goroutine bits without breaking the downstream API.
- kitd 3y agoChannels broadly have footguns around how closed and nil channels are treated I appreciate your concerns but one could say similar things about nil pointers or accessing slices out of range. Anything you use should be handled with care.