mirror of
https://github.com/anchore/syft.git
synced 2026-11-02 07:26:34 +01:00
Normalize syft-json output (#1194)
This commit is contained in:
@@ -215,6 +215,15 @@ func toRelationshipModel(relationships []artifact.Relationship) []model.Relation
|
||||
Metadata: r.Data,
|
||||
}
|
||||
}
|
||||
sort.Slice(result, func(i, j int) bool {
|
||||
if iParent, jParent := result[i].Parent, result[j].Parent; iParent != jParent {
|
||||
return iParent < jParent
|
||||
}
|
||||
if iChild, jChild := result[i].Child, result[j].Child; iChild != jChild {
|
||||
return iChild < jChild
|
||||
}
|
||||
return result[i].Type < result[j].Type
|
||||
})
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user