distro: add new constructor for getting UnkownDistros

Signed-off-by: Alfredo Deza <adeza@anchore.com>
This commit is contained in:
Alfredo Deza 2020-07-17 13:06:25 -04:00
parent f03f7b32e9
commit f51cae2043

View File

@ -12,6 +12,13 @@ type Distro struct {
RawVersion string RawVersion string
} }
// NewUnknownDistro creates a standardized UnkownDistro with a "0.0.0" version
func NewUnknownDistro() Distro {
return Distro{
Type: UnknownDistro,
}
}
func NewDistro(t Type, ver string) (Distro, error) { func NewDistro(t Type, ver string) (Distro, error) {
verObj, err := hashiVer.NewVersion(ver) verObj, err := hashiVer.NewVersion(ver)
if err != nil { if err != nil {