mirror of
https://github.com/anchore/syft.git
synced 2026-11-02 07:26:34 +01:00
Fix: unmarshal key values in Java, Go, and Conan metadata (#2603)
Previously, Syft represented several metadata fields as map[string]string, however this representation erased ordering, so Syft now represents these values as []KeyValue. Add custom unmarshaling so that JSON that was written by older versions of Syft using the map[string]string representation can be parsed into the new []KeyValue representation. Signed-off-by: Will Murphy <will.murphy@anchore.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
"debug/macho"
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
"github.com/bmatcuk/doublestar/v4"
|
||||
"github.com/dustin/go-humanize"
|
||||
@@ -28,8 +29,10 @@ type Cataloger struct {
|
||||
}
|
||||
|
||||
func DefaultConfig() Config {
|
||||
m := mimetype.ExecutableMIMETypeSet.List()
|
||||
sort.Strings(m)
|
||||
return Config{
|
||||
MIMETypes: mimetype.ExecutableMIMETypeSet.List(),
|
||||
MIMETypes: m,
|
||||
Globs: nil,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user