Skip to content

Commit eacf32a

Browse files
fix for lint
1 parent 75a8d5c commit eacf32a

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

internal/cmd/report/license/license.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func RunE(r report.IReporter) func(_ *cobra.Command, args []string) error {
4848
}
4949

5050
if err := r.Order(orderArgs); err != nil {
51-
return fmt.Errorf("%s %s\n", color.RedString("⨯"), err.Error())
51+
return fmt.Errorf("%s\n", color.RedString("⨯")+" "+err.Error())
5252
}
5353

5454
fmt.Printf("%s Successfully ordered license export\n", color.GreenString("✔"))

internal/cmd/report/sbom/sbom.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func RunE(r report.IReporter) func(_ *cobra.Command, args []string) error {
8686
}
8787

8888
if err := r.Order(orderArgs); err != nil {
89-
return fmt.Errorf("%s %s", color.RedString("⨯"), err.Error())
89+
return fmt.Errorf("%s", color.RedString("⨯")+" "+err.Error())
9090
}
9191

9292
return nil

internal/cmd/report/vulnerability/vulnerability.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func RunE(r report.IReporter) func(_ *cobra.Command, args []string) error {
3838
return func(_ *cobra.Command, _ []string) error {
3939
orderArgs := vulnerability.OrderArgs{Email: viper.GetString(EmailFlag)}
4040
if err := r.Order(orderArgs); err != nil {
41-
return fmt.Errorf("%s %s\n", color.RedString("⨯"), err.Error())
41+
return fmt.Errorf("%s\n", color.RedString("⨯")+" "+err.Error())
4242
}
4343

4444
fmt.Printf("%s Successfully ordered vulnerability export\n", color.GreenString("✔"))

internal/cmd/scan/scan.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func RunE(s *scan.IScanner) func(_ *cobra.Command, args []string) error {
270270

271271
return scanCmdError
272272
} else if scanCmdError != nil {
273-
return fmt.Errorf("%s %s\n", color.RedString("⨯"), scanCmdError.Error())
273+
return fmt.Errorf("%s\n", color.RedString("⨯")+" "+scanCmdError.Error())
274274
}
275275

276276
return scanCmdError

internal/fingerprint/fingerprint.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -447,19 +447,20 @@ func inMemFingerprintZipContent(filename string, exclusions []string, inclusions
447447

448448
_, err = io.Copy(hasher, rc) // #nosec
449449
if err != nil {
450-
rc.Close()
450+
rc.Close()
451451

452-
return nil, err
453-
}
452+
return nil, err
453+
}
454454

455-
fingerprints = append(fingerprints, FileFingerprint{
456-
path: longFileName,
457-
contentLength: int64(f.UncompressedSize64),
458-
fingerprint: hasher.Sum(nil),
459-
})
455+
// #nosec G115 - UncompressedSize64 is always positive and within int64 range for valid zip files
456+
fingerprints = append(fingerprints, FileFingerprint{
457+
path: longFileName,
458+
contentLength: int64(f.UncompressedSize64),
459+
fingerprint: hasher.Sum(nil),
460+
})
460461

461-
rc.Close()
462-
}
462+
rc.Close()
463+
}
463464

464465
return fingerprints, nil
465466
}

0 commit comments

Comments
 (0)