Skip to content

Commit

Permalink
Merge pull request hashicorp#328 from hashicorp/export-tar
Browse files Browse the repository at this point in the history
export tar decompressor
  • Loading branch information
schmichael authored Jun 30, 2021
2 parents 04c5139 + 6a2a051 commit a7e02da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion decompress.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Decompressor interface {
var Decompressors map[string]Decompressor

func init() {
tarDecompressor := new(tarDecompressor)
tarDecompressor := new(TarDecompressor)
tbzDecompressor := new(TarBzip2Decompressor)
tgzDecompressor := new(TarGzipDecompressor)
txzDecompressor := new(TarXzDecompressor)
Expand Down
6 changes: 3 additions & 3 deletions decompress_tar.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ func untar(input io.Reader, dst, src string, dir bool, umask os.FileMode) error
return nil
}

// tarDecompressor is an implementation of Decompressor that can
// TarDecompressor is an implementation of Decompressor that can
// unpack tar files.
type tarDecompressor struct{}
type TarDecompressor struct{}

func (d *tarDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error {
func (d *TarDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error {
// If we're going into a directory we should make that first
mkdir := dst
if !dir {
Expand Down
4 changes: 2 additions & 2 deletions decompress_tar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestTar(t *testing.T) {
cases[i].Input = filepath.Join("./testdata", "decompress-tar", tc.Input)
}

TestDecompressor(t, new(tarDecompressor), cases)
TestDecompressor(t, new(TarDecompressor), cases)
}

// testDecompressPermissions decompresses a directory and checks the permissions of the expanded files
Expand Down Expand Up @@ -76,7 +76,7 @@ func testDecompressorPermissions(t *testing.T, d Decompressor, input string, exp
}

func TestDecompressTarPermissions(t *testing.T) {
d := new(tarDecompressor)
d := new(TarDecompressor)
input := "./test-fixtures/decompress-tar/permissions.tar"

var expected map[string]int
Expand Down

0 comments on commit a7e02da

Please sign in to comment.