Why not, instead of passing a file path as a parameter, pass a function that 
returns a ReadCloser (and error, of course). That way, you can preserve the 
existing semantics of your function, but move the decision of what to open, how 
to open, and how to handle the error for when it fails - all out of your 
function.

Or just use a temp file.

Eric

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to