Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New interface #102

Closed
Elexy opened this issue Nov 7, 2018 · 2 comments
Closed

New interface #102

Elexy opened this issue Nov 7, 2018 · 2 comments

Comments

@Elexy
Copy link

Elexy commented Nov 7, 2018

With your last change, the interface changed and I am trying to move from archiver.Tar.Make(... to the new interface, but not having any luck. A bit of a Go novice, so please bare with me.

"github.com/mholt/archiver"
...
err := archiver.Archiver.Archive([]string{
		"src",
		"test",
		"help"
	}, "/tmp/some.tar")

gives me:

./main.go:32:34: not enough arguments in call to method expression archiver.Archiver.Archive
	have ([]string, string)
	want (archiver.Archiver, []string, string)
@mholt
Copy link
Owner

mholt commented Nov 7, 2018

The new equivalent of the old archiver.Tar.Make() is something like this:

t := archiver.Tar{
    // ... configuration; see godoc
}
err := t.Archive([]string{"src", "test", "help"}, "/tmp/some.tar")
if err != nil {
    return err
}

You can find the configuration fields for the Tar type here: https://godoc.org/github.com/mholt/archiver#Tar

@Elexy
Copy link
Author

Elexy commented Nov 7, 2018

Thanks @mholt for the quick response.
Thanks for great lib/tool, obviously ;-)

@Elexy Elexy closed this as completed Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants