Skip to content

Commit

Permalink
fix linter problems
Browse files Browse the repository at this point in the history
  • Loading branch information
BenAlvo1 committed Jul 9, 2024
1 parent 954935f commit f20d02d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 1 addition & 5 deletions internal/commands/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -1333,11 +1333,7 @@ func enrichScaResults(
func parseExportVulnerabilityType(types []wrappers.ScaType) *[]wrappers.ScaTypeCollection {
var scaTypes []wrappers.ScaTypeCollection
for _, t := range types {
scaTypes = append(scaTypes, wrappers.ScaTypeCollection{
ID: t.ID,
Type: t.Type,
IsIgnored: t.IsIgnored,
})
scaTypes = append(scaTypes, t.ToCollection())
}
return &scaTypes
}
Expand Down
2 changes: 1 addition & 1 deletion internal/wrappers/export-http.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (e *ExportHTTPWrapper) GetExportPackage(scanID string) (*ScaPackageCollecti
if err != nil {
return nil, err
}
logger.PrintIfVerbose("Retrieved SCA package collection export successfully")
logger.PrintIfVerbose("Retrieved SCA package collection from export service successfully")

return scaPackageCollection, nil
}
Expand Down
8 changes: 8 additions & 0 deletions internal/wrappers/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ type ScaType struct {
IsIgnored bool `json:"IsIgnored,omitempty"`
}

func (t ScaType) ToCollection() ScaTypeCollection {
return ScaTypeCollection{

Check failure on line 38 in internal/wrappers/export.go

View workflow job for this annotation

GitHub Actions / lint

S1016: should convert t (type ScaType) to ScaTypeCollection instead of using struct literal (gosimple)
ID: t.ID,
Type: t.Type,
IsIgnored: t.IsIgnored,
}
}

type RequestPayload struct {
ScanID string `json:"ScanId"`
FileFormat string `json:"FileFormat"`
Expand Down

0 comments on commit f20d02d

Please sign in to comment.