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:32:53 -04:00
parent f03f7b32e9
commit f51cae2043
+7
View File
@@ -12,6 +12,13 @@ type Distro struct {
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) {
verObj, err := hashiVer.NewVersion(ver)
if err != nil {