@@ -73,7 +73,7 @@ func Run(ctx context.Context, ep *Params) error {
73
73
func handleURL (path string ) (string , string , error ) {
74
74
u , err := url .Parse (path )
75
75
if err != nil {
76
- return "" , "" , fmt .Errorf ("failed to parse urlPath: %v " , err )
76
+ return "" , "" , fmt .Errorf ("failed to parse urlPath: %w " , err )
77
77
}
78
78
79
79
parts := strings .Split (u .Path , "/" )
@@ -107,9 +107,10 @@ func IsGit(in string) bool {
107
107
}
108
108
109
109
func ProcessURL (url string , file afero.File ) (afero.File , error ) {
110
+ //nolint: gosec
110
111
resp , err := http .Get (url )
111
112
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 )
113
114
}
114
115
defer resp .Body .Close ()
115
116
@@ -178,9 +179,7 @@ func handlePaths(ctx context.Context, ep *Params) error {
178
179
docs = append (docs , doc )
179
180
scores = append (scores , score )
180
181
paths = append (paths , sbomFilePath )
181
-
182
182
} else {
183
-
184
183
log .Debugf ("Processing path :%s\n " , path )
185
184
pathInfo , _ := os .Stat (path )
186
185
if pathInfo .IsDir () {
@@ -256,9 +255,7 @@ func processFile(ctx context.Context, ep *Params, path string, fs billy.Filesyst
256
255
fmt .Printf ("failed to parse %s : %s\n " , path , err )
257
256
return nil , nil , err
258
257
}
259
-
260
258
} else {
261
-
262
259
if _ , err := os .Stat (path ); err != nil {
263
260
log .Debugf ("os.Stat failed for file :%s\n " , path )
264
261
fmt .Printf ("failed to stat %s\n " , path )
0 commit comments