2 ms·
The inner goroutine cannot return because it blocks at found<-P, because found is not buffered and there is no reader. This would work if the consumer was star
by jeffbee 6y ago
The inner goroutine cannot return because it blocks at found<-P, because found is not buffered and there is no reader.
This would work if the consumer was started in a goroutine first.
- xmprt 6y agoThanks. The part about starting the consumer in a goroutine actually made more sense as a solution than either of the given solutions. I guess I completely forgot how channels work and didn't realize that until there's a reader, the channel will block (which makes perfect sense in hindsight).