mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
22 lines
445 B
Go
22 lines
445 B
Go
package cyclonedxhelpers
|
|
|
|
import (
|
|
"github.com/CycloneDX/cyclonedx-go"
|
|
|
|
"github.com/anchore/syft/internal/formats/common"
|
|
)
|
|
|
|
var (
|
|
CycloneDXFields = common.RequiredTag("cyclonedx")
|
|
)
|
|
|
|
func encodeProperties(obj interface{}, prefix string) (out []cyclonedx.Property) {
|
|
for _, p := range common.Sorted(common.Encode(obj, prefix, CycloneDXFields)) {
|
|
out = append(out, cyclonedx.Property{
|
|
Name: p.Name,
|
|
Value: p.Value,
|
|
})
|
|
}
|
|
return
|
|
}
|