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>
16 lines
313 B
Go
16 lines
313 B
Go
package cyclonedxhelpers
|
|
|
|
import "github.com/anchore/syft/syft/pkg"
|
|
|
|
func Description(p pkg.Package) string {
|
|
if hasMetadata(p) {
|
|
switch metadata := p.Metadata.(type) {
|
|
case pkg.ApkMetadata:
|
|
return metadata.Description
|
|
case pkg.NpmPackageJSONMetadata:
|
|
return metadata.Description
|
|
}
|
|
}
|
|
return ""
|
|
}
|