Skip to content

Commit

Permalink
refactor: rename AddVulnerabilities to SetVulnerabilities
Browse files Browse the repository at this point in the history
Signed-off-by: knqyf263 <[email protected]>
  • Loading branch information
knqyf263 committed Sep 16, 2024
1 parent 8b33309 commit 67961d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/sbom/core/bom.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ func (b *BOM) AddVulnerability(c *Component, vuln Vulnerability) {
b.vulnerabilities[c.id] = append(b.vulnerabilities[c.id], vuln)
}

func (b *BOM) AddVulnerabilities(c *Component, vulns []Vulnerability) {
func (b *BOM) SetVulnerabilities(c *Component, vulns []Vulnerability) {
if c.id == uuid.Nil {
b.AddComponent(c)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/sbom/io/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func (e *Encoder) encodePackages(parent *core.Component, result types.Result) {

// Add vulnerabilities
if vv := vulns[pkg.Identifier.UID]; vv != nil {
e.bom.AddVulnerabilities(c, vv)
e.bom.SetVulnerabilities(c, vv)
}

// Handle a root package
Expand Down

0 comments on commit 67961d7

Please sign in to comment.