mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
* Improve CycloneDX format output ## Additions to CycloneDX output * CPEs * Authors * Publishers * External References (Website, Distribution, VCS) * Description Signed-off-by: Sambhav Kothari <skothari44@bloomberg.net>
13 lines
299 B
Go
13 lines
299 B
Go
package cyclonedxhelpers
|
|
|
|
import "github.com/anchore/syft/syft/pkg"
|
|
|
|
func CPE(p pkg.Package) string {
|
|
// Since the CPEs in a package are sorted by specificity
|
|
// we can extract the first CPE as the one to output in cyclonedx
|
|
if len(p.CPEs) > 0 {
|
|
return pkg.CPEString(p.CPEs[0])
|
|
}
|
|
return ""
|
|
}
|