Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ func doWorkAndGetResult(ctx context.Context, builders []*builder, dataMap map[st
}
wg.Wait() // wait for work to be processed
close(outChan)
errs := make([]error, 0)
for o := range outChan {
if o.err != nil {
return o.err
Expand All @@ -172,12 +173,18 @@ func doWorkAndGetResult(ctx context.Context, builders []*builder, dataMap map[st
// 0-> data, 1-> error
if !outputs[1].IsNil() {
// error occured, return it back and stop processing
return outputs[1].Interface().(error)
errs = append(errs, outputs[1].Interface().(error))
continue
}
// add result
name := getStructName(outputs[0].Type())
dataMap[name] = outputs[0].Interface()
}
if len(errs) > 0 {
// we only return the first error
// TODO enhance error handling
return errs[0]
}
return nil
}

Expand Down