On 7 Feb 2018, at 14:45, Justin Azoff 
<justin.az...@gmail.com<mailto:justin.az...@gmail.com>> wrote:

Is there some way to inspect that error to figure out that it was related to 
reading from 'gr' and not writing to /dev/null?

Two options that come to mind are

 - handling the copy yourself so you get separate Read() and Write() calls and 
can handle their returns accordingly

 - wrapping the writer in a type that wraps the Write() call and retains any 
error returned. You can then ask the writer if it encountered an error after 
getting an error return from io.Copy.

I’m sure there are other ways.

//jb

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to