Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Add Read and Write methods to Archiver interface that accept io.Reader/io.Writer. #43

Merged
merged 2 commits into from
Oct 12, 2017

Conversation

jservice-rvbd
Copy link
Contributor

  1. Adds methods to interface.
  2. Implement methods for each format.
  3. Reimplement Make/Open so that code is shared.

This intended to implement a solution to issue #20.

…r/io.Writer.

1. Adds methods to interface.
2. Implement methods for each format.
3. Reimplement Make/Open so that code is shared.
// Write writes an archive to a Writer.
Write(output io.Writer, sources []string) error
// Read reads an archive from a Reader.
Read(input io.Reader, destination string) error
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apicompat: breaking change members added

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good bot 🐕


// symmetricTest compares the contents of a destination directory to the contents
// of the test corpus and tests that they are equal.
func symmetricTest(t *testing.T, name, dest string) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unparam: name is unused

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed by next commit.

… os.RemoveAll I accidentally left commented out.
Open(source, destination string) error
// Write writes an archive to a Writer.
Write(output io.Writer, sources []string) error
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apicompat: breaking change members added

Copy link
Owner

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR! Sorry it took me a while to get to this. The change looks thorough, and the interface changes are acceptable; probably about what I would have done. Error checking and formatting looks good... tests check out... so, thanks!

@mholt mholt merged commit 548c791 into mholt:master Oct 12, 2017
@niski84
Copy link

niski84 commented Jul 14, 2018

this broke multipart rar files ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants