cmd: IdentifyDistro returns a distro object which can be nil

Signed-off-by: Alfredo Deza <adeza@anchore.com>
This commit is contained in:
Alfredo Deza 2020-06-12 10:45:49 -04:00
parent dba5f0b197
commit 75375d0b58

View File

@ -56,11 +56,11 @@ func doRunCmd(_ *cobra.Command, args []string) int {
defer stereoscope.Cleanup() defer stereoscope.Cleanup()
log.Info("Identifying Distro") log.Info("Identifying Distro")
distro, err := imgbom.IdentifyDistro(img) distro := imgbom.IdentifyDistro(img)
if err != nil { if distro == nil {
log.Errorf("error identifying Distro: %w", err) log.Errorf("error identifying distro")
} else { } else {
log.Info(" Distro: %s", distro) log.Infof(" Distro: %s", distro)
} }
log.Info("Cataloging image") log.Info("Cataloging image")