mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
use filepath.Base() instead of path.Base() for temp files (#882)
This commit is contained in:
parent
f24bbc1838
commit
1aeda6bb50
@ -5,14 +5,13 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/anchore/syft/internal/log"
|
"github.com/anchore/syft/internal/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func saveArchiveToTmp(archiveVirtualPath string, reader io.Reader) (string, string, func(), error) {
|
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-")
|
tempDir, err := ioutil.TempDir("", "syft-archive-contents-")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", "", func() {}, fmt.Errorf("unable to create tempdir for archive processing: %w", err)
|
return "", "", func() {}, fmt.Errorf("unable to create tempdir for archive processing: %w", err)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user