Skip to content

Instantly share code, notes, and snippets.

View Sommerrolle's full-sized avatar

Cuong Vo Ta Sommerrolle

View GitHub Profile
// Untar takes a destination path and a reader; a tar reader loops over the tarfile
// creating the file structure at 'dst' along the way, and writing any files
func Untar(dst string, r io.Reader) error {
gzr, err := gzip.NewReader(r)
if err != nil {
return err
}
defer gzr.Close()