You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd recommend renaming the API to allow a general io.Reader and io.Writer. Currently, you are forced to interact with on-disk files only. What if I want to write to a .tar.gz from a HTTP response body, etc.? Feel free to check the Reddit comments here for more on this.
I was faced with a similar problem with my email package. I resolved it by making Attach() (in your case Compress() and Extract()) take an io.Reader (or io.Writer) as the argument, and made a separate function, AttachFile(), which served as a convenience function.
So, I propose that you make Compress() and Extract() more general and allow any reader and writer, and make new functions, CompressFile() and ExtractFile() serve as convenience.
I understand that you're aiming for simplicity, but in this case much more flexibility comes with little sacrifice to usability. Just a thought.
Keep up the good work!
The text was updated successfully, but these errors were encountered:
Thank you for taking the time to add this issue, with a lot of background info.
Sounds like a good idea, I don't know if I will add this right now though. I will keep this issue open, and take a look at it next time I get a little time to work on side projects like this.
Nice job!!
I'd recommend renaming the API to allow a general
io.Reader
andio.Writer
. Currently, you are forced to interact with on-disk files only. What if I want to write to a .tar.gz from a HTTP response body, etc.? Feel free to check the Reddit comments here for more on this.I was faced with a similar problem with my email package. I resolved it by making
Attach()
(in your caseCompress()
andExtract()
) take anio.Reader
(orio.Writer
) as the argument, and made a separate function,AttachFile()
, which served as a convenience function.So, I propose that you make
Compress()
andExtract()
more general and allow any reader and writer, and make new functions,CompressFile()
andExtractFile()
serve as convenience.I understand that you're aiming for simplicity, but in this case much more flexibility comes with little sacrifice to usability. Just a thought.
Keep up the good work!
The text was updated successfully, but these errors were encountered: