From 1aeda6bb506dafce7432bd462c829c35df1dfafd Mon Sep 17 00:00:00 2001 From: Oscar Hallgren Date: Fri, 1 Apr 2022 16:42:22 +0200 Subject: [PATCH] use filepath.Base() instead of path.Base() for temp files (#882) --- syft/pkg/cataloger/java/save_archive_to_tmp.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/syft/pkg/cataloger/java/save_archive_to_tmp.go b/syft/pkg/cataloger/java/save_archive_to_tmp.go index ff7c83a57..e8a4abe47 100644 --- a/syft/pkg/cataloger/java/save_archive_to_tmp.go +++ b/syft/pkg/cataloger/java/save_archive_to_tmp.go @@ -5,14 +5,13 @@ import ( "io" "io/ioutil" "os" - "path" "path/filepath" "github.com/anchore/syft/internal/log" ) func saveArchiveToTmp(archiveVirtualPath string, reader io.Reader) (string, string, func(), error) { - name := path.Base(archiveVirtualPath) + name := filepath.Base(archiveVirtualPath) tempDir, err := ioutil.TempDir("", "syft-archive-contents-") if err != nil { return "", "", func() {}, fmt.Errorf("unable to create tempdir for archive processing: %w", err)