Bug fix for 1095 - syft conversion option error (#1177)

Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Christopher Angelo Phillips
2022-08-25 17:36:15 -04:00
committed by GitHub
co-authored by Alex Goodman
parent 2c882f6239
commit 615f933d98
14 changed files with 106 additions and 20 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ package file
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/bmatcuk/doublestar/v4"
@@ -33,7 +33,7 @@ func ExtractGlobsFromTarToUniqueTempFile(archivePath, dir string, globs ...strin
// we have a file we want to extract....
tempfilePrefix := filepath.Base(filepath.Clean(file.Name())) + "-"
tempFile, err := ioutil.TempFile(dir, tempfilePrefix)
tempFile, err := os.CreateTemp(dir, tempfilePrefix)
if err != nil {
return fmt.Errorf("unable to create temp file: %w", err)
}
+1 -2
View File
@@ -4,7 +4,6 @@ import (
"archive/zip"
"bytes"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
@@ -82,7 +81,7 @@ func ExtractFromZipToUniqueTempFile(archivePath, dir string, paths ...string) (m
visitor := func(file *zip.File) error {
tempfilePrefix := filepath.Base(filepath.Clean(file.Name)) + "-"
tempFile, err := ioutil.TempFile(dir, tempfilePrefix)
tempFile, err := os.CreateTemp(dir, tempfilePrefix)
if err != nil {
return fmt.Errorf("unable to create temp file: %w", err)
}
+1 -2
View File
@@ -4,7 +4,6 @@ import (
"fmt"
"io"
"io/fs"
"io/ioutil"
"os"
"github.com/sirupsen/logrus"
@@ -55,7 +54,7 @@ func NewLogrusLogger(cfg LogrusConfig) *LogrusLogger {
}
output = logFile
default:
output = ioutil.Discard
output = io.Discard
}
appLogger.SetOutput(output)
+2 -2
View File
@@ -2,7 +2,7 @@ package version
import (
"fmt"
"io/ioutil"
"io"
"net/http"
"strings"
@@ -59,7 +59,7 @@ func fetchLatestApplicationVersion() (*hashiVersion.Version, error) {
return nil, fmt.Errorf("HTTP %d on fetching latest version: %s", resp.StatusCode, resp.Status)
}
versionBytes, err := ioutil.ReadAll(resp.Body)
versionBytes, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("failed to read latest version: %w", err)
}