Skip to content

Commit

Permalink
lint: extract: Fix 'unused-parameter' error
Browse files Browse the repository at this point in the history
pkg/extract/extract.go:30:44: unused-parameter: parameter 'showProgress' seems to be unused, consider removing or renaming it as _ (revive)
func Uncompress(tarball, targetDir string, showProgress bool) ([]string, error) {
  • Loading branch information
cfergeau authored and praveenkumar committed Aug 4, 2023
1 parent f85a6bb commit 9ff7964
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/compress/compress_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func testCompress(t *testing.T, baseDir string) {

destDir := t.TempDir()

fileList, err := extract.Uncompress(testArchiveName, destDir, false)
fileList, err := extract.Uncompress(testArchiveName, destDir)
require.NoError(t, err)

_, d := filepath.Split(baseDir)
Expand Down
2 changes: 1 addition & 1 deletion pkg/crc/image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func PullBundle(preset crcpreset.Preset, imageURI string) (string, error) {
if err != nil {
return "", err
}
fileList, err := extract.Uncompress(filepath.Join(destDir, imgLayer), constants.MachineCacheDir, true)
fileList, err := extract.Uncompress(filepath.Join(destDir, imgLayer), constants.MachineCacheDir)
if err != nil {
return "", err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/crc/machine/bundle/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (repo *Repository) Extract(path string) error {
_ = os.RemoveAll(tmpDir) // clean up after using it
}()

if _, err := extract.Uncompress(path, tmpDir, true); err != nil {
if _, err := extract.Uncompress(path, tmpDir); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/extract/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func UncompressWithFilter(tarball, targetDir string, fileFilter func(string) boo
return uncompress(tarball, targetDir, fileFilter, false) // never show detailed output
}

func Uncompress(tarball, targetDir string, showProgress bool) ([]string, error) {
func Uncompress(tarball, targetDir string) ([]string, error) {
return uncompress(tarball, targetDir, nil, terminal.IsShowTerminalOutput())
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/extract/extract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func testUncompress(t *testing.T, archiveName string, fileFilter func(string) bo
if fileFilter != nil {
fileList, err = UncompressWithFilter(archiveName, destDir, fileFilter)
} else {
fileList, err = Uncompress(archiveName, destDir, false)
fileList, err = Uncompress(archiveName, destDir)
}
if err != nil {
return err
Expand Down

0 comments on commit 9ff7964

Please sign in to comment.