Skip to content

Commit a7e02da

Browse files
authored
Merge pull request #328 from hashicorp/export-tar
export tar decompressor
2 parents 04c5139 + 6a2a051 commit a7e02da

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

decompress.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type Decompressor interface {
2323
var Decompressors map[string]Decompressor
2424

2525
func init() {
26-
tarDecompressor := new(tarDecompressor)
26+
tarDecompressor := new(TarDecompressor)
2727
tbzDecompressor := new(TarBzip2Decompressor)
2828
tgzDecompressor := new(TarGzipDecompressor)
2929
txzDecompressor := new(TarXzDecompressor)

decompress_tar.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ func untar(input io.Reader, dst, src string, dir bool, umask os.FileMode) error
125125
return nil
126126
}
127127

128-
// tarDecompressor is an implementation of Decompressor that can
128+
// TarDecompressor is an implementation of Decompressor that can
129129
// unpack tar files.
130-
type tarDecompressor struct{}
130+
type TarDecompressor struct{}
131131

132-
func (d *tarDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error {
132+
func (d *TarDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error {
133133
// If we're going into a directory we should make that first
134134
mkdir := dst
135135
if !dir {

decompress_tar_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func TestTar(t *testing.T) {
4242
cases[i].Input = filepath.Join("./testdata", "decompress-tar", tc.Input)
4343
}
4444

45-
TestDecompressor(t, new(tarDecompressor), cases)
45+
TestDecompressor(t, new(TarDecompressor), cases)
4646
}
4747

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

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

8282
var expected map[string]int

0 commit comments

Comments
 (0)