It reads from an io.Reader and sends the bytes it reads on a channel until it can receive from the done channel.
The problem is, once a value's ready on the done channel, the goroutine still has to wait for Read before it can receive. This can take an arbitrarily long amount of time depending on the Reader.
I can close the Reader from another goroutine, but then I end up logging the error from Read, and there's no good way to filter out the expected "this Reader is closed" error. If it happens often, logs are full of clutter.
Is there a solution, aside from writing fragile code to detect the "this Reader is closed" error for every type of Reader imaginable?