mirror of
https://github.com/anchore/syft.git
synced 2026-11-03 16:06:36 +01:00
Fix panic on empty sbom (#917)
* Implement fmt.Stringer with format.ID Signed-off-by: Dan Luhring <dan+github@luhrings.com> * Add failing test for formats processing empty SBOMs Signed-off-by: Dan Luhring <dan+github@luhrings.com> * Account for nil SPDX document during Syft model conversion Signed-off-by: Dan Luhring <dan+github@luhrings.com>
This commit is contained in:
@@ -13,6 +13,11 @@ var (
|
||||
|
||||
type FormatID string
|
||||
|
||||
// String returns a string representation of the FormatID.
|
||||
func (f FormatID) String() string {
|
||||
return string(f)
|
||||
}
|
||||
|
||||
type Format interface {
|
||||
ID() FormatID
|
||||
Encode(io.Writer, SBOM) error
|
||||
|
||||
Reference in New Issue
Block a user