fix error handling

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
Jakub Sztandera 2019-03-21 22:06:22 +01:00
parent 5a1a03bd8f
commit 2e8ead8df1

View File

@ -118,9 +118,13 @@ Print out all dependencies and their versions.`,
}
return
}
res.Emit(toDependency(&info.Main))
if err := res.Emit(toDependency(&info.Main)); err != nil {
return err
}
for _, dep := range info.Deps {
res.Emit(toDependency(dep))
if err := res.Emit(toDependency(dep)); err != nil {
return err
}
}
return nil
},
@ -131,7 +135,7 @@ Print out all dependencies and their versions.`,
fmt.Fprintf(w, " => %s", dep.ReplacedBy)
}
fmt.Fprintf(w, "\n")
return errors.New("test")
return nil
}),
},
}