Skip to content

API Method Naming #1

@jordan-wright

Description

@jordan-wright

Nice job!!

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!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions