Let the checker return a list of hints along with errors

This commit is contained in:
Alexander Neumann committed 2015-10-25 16:26:50 +01:00
1 parent 91e1929b52
commit 96ecc26507
3 files changed
+79 -18

No files matched your search

+11 -2
View File
@@ -50,8 +50,17 @@ func (cmd CmdCheck) Execute(args []string) error {
chkr := checker.New(repo)
cmd.global.Verbosef("Load indexes\n")
if err = chkr.LoadIndex(); err != nil {
return err
hints, errs := chkr.LoadIndex()
for _, hint := range hints {
cmd.global.Printf("%v\n", hint)
}
if len(errs) > 0 {
for _, err := range errs {
cmd.global.Warnf("error: %v\n", err)
}
return fmt.Errorf("LoadIndex returned errors")
}
done := make(chan struct{})