Preserve syft IDs on SBOM decode (#963)

This commit is contained in:
Alex Goodman
2022-04-18 18:10:55 +00:00
committed by GitHub
parent 248023baaf
commit 172ecc0d77
2 changed files with 9 additions and 1 deletions
+4
View File
@@ -28,6 +28,10 @@ type Package struct {
Metadata interface{} // additional data found while parsing the package source
}
func (p *Package) OverrideID(id artifact.ID) {
p.id = id
}
func (p *Package) SetID() {
id, err := artifact.IDByHash(p)
if err != nil {