Skip to content

Commit cc1626e

Browse files
committed
fix lint errors after reolved conflict
Signed-off-by: Vivek Kumar Sahu <[email protected]>
1 parent 322242f commit cc1626e

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

pkg/engine/compliance.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,7 @@ func getSbomDocument(ctx context.Context, ep *Params) (*sbom.Document, error) {
104104
if err != nil {
105105
log.Fatalf("failed to parse SBOM document: %w", err)
106106
}
107-
108107
} else {
109-
110108
if _, err := os.Stat(path); err != nil {
111109
log.Debugf("os.Stat failed for file :%s\n", path)
112110
fmt.Printf("failed to stat %s\n", path)

pkg/engine/score.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func Run(ctx context.Context, ep *Params) error {
7373
func handleURL(path string) (string, string, error) {
7474
u, err := url.Parse(path)
7575
if err != nil {
76-
return "", "", fmt.Errorf("failed to parse urlPath: %v", err)
76+
return "", "", fmt.Errorf("failed to parse urlPath: %w", err)
7777
}
7878

7979
parts := strings.Split(u.Path, "/")
@@ -107,9 +107,10 @@ func IsGit(in string) bool {
107107
}
108108

109109
func ProcessURL(url string, file afero.File) (afero.File, error) {
110+
//nolint: gosec
110111
resp, err := http.Get(url)
111112
if err != nil {
112-
return nil, fmt.Errorf("failed to get data: %v", err)
113+
return nil, fmt.Errorf("failed to get data: %w", err)
113114
}
114115
defer resp.Body.Close()
115116

@@ -178,9 +179,7 @@ func handlePaths(ctx context.Context, ep *Params) error {
178179
docs = append(docs, doc)
179180
scores = append(scores, score)
180181
paths = append(paths, sbomFilePath)
181-
182182
} else {
183-
184183
log.Debugf("Processing path :%s\n", path)
185184
pathInfo, _ := os.Stat(path)
186185
if pathInfo.IsDir() {
@@ -256,9 +255,7 @@ func processFile(ctx context.Context, ep *Params, path string, fs billy.Filesyst
256255
fmt.Printf("failed to parse %s : %s\n", path, err)
257256
return nil, nil, err
258257
}
259-
260258
} else {
261-
262259
if _, err := os.Stat(path); err != nil {
263260
log.Debugf("os.Stat failed for file :%s\n", path)
264261
fmt.Printf("failed to stat %s\n", path)

0 commit comments

Comments
 (0)