Skip to content
Go package to natively decompress and unarchive tar.gz, tar.bzip2, tar.xz, zip and tar files.
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
fixtures
.editorconfig
.travis.yml
AUTHORS
CONTRIBUTING.md
LICENSE
README.md
unpackit.go
unpackit_test.go

README.md

UnpackIt

GoDoc Build Status

This Go library allows you to easily unpack the following files using magic numbers:

  • tar.gz
  • tar.bzip2
  • tar.xz
  • zip
  • tar

Usage

Unpack a file:

    file, _ := os.Open(test.filepath)
    destPath, err := unpackit.Unpack(file, tempDir)

Unpack a stream (such as a http.Response):

    res, err := http.Get(url)
    destPath, err := unpackit.Unpack(res.Body, tempDir)
You can’t perform that action at this time.