mirror of
https://github.com/anchore/syft.git
synced 2026-11-02 23:46:35 +01:00
chore(deps): update Go version (#4773)
Signed-off-by: anchore-oss-update-bot <anchore-oss-update-bot@users.noreply.github.com> Co-authored-by: anchore-oss-update-bot <anchore-oss-update-bot@users.noreply.github.com>
This commit is contained in:
co-authored by
anchore-oss-update-bot
parent
26e87c7cd3
commit
5b58ec96b7
+1
-5
@@ -105,17 +105,13 @@ func IsValid(p *Package) bool {
|
||||
return p != nil && p.Name != ""
|
||||
}
|
||||
|
||||
//nolint:gocognit
|
||||
func Less(i, j Package) bool {
|
||||
if i.Name == j.Name {
|
||||
if i.Version == j.Version {
|
||||
iLocations := i.Locations.ToSlice()
|
||||
jLocations := j.Locations.ToSlice()
|
||||
if i.Type == j.Type {
|
||||
maxLen := len(iLocations)
|
||||
if len(jLocations) > maxLen {
|
||||
maxLen = len(jLocations)
|
||||
}
|
||||
maxLen := max(len(jLocations), len(iLocations))
|
||||
for l := 0; l < maxLen; l++ {
|
||||
if len(iLocations) < l+1 || len(jLocations) < l+1 {
|
||||
if len(iLocations) == len(jLocations) {
|
||||
|
||||
Reference in New Issue
Block a user