targo
provides functions to create or extract tar archives. This package has
no dependencies and relies only on the Go standard library.
Usage (full documentation here)
func Create(destPath, dirPath string) error
: create a tar archive fromdirPath
intodestPath
.func CreateInPlace(dirPath string) error
: create a tar archive fromdirPath
"in-place", iedirPath
is removed once the archive has been created and adirPath.tar
file is created.func Extract(destPath, archivePath string) error
: extract a tar archive fromarchivePath
intodestPath
.func ExtractInPlace(archivePath string) error
: extract a tar archive fromarchivePath
"in-place", iearchivePath
is removed after the archive has been extracted (note: it expectsarchivePath
to have a file extension).