simplify error propagation

pull/432/merge
Darien Raymond 8 years ago
parent bf64c449de
commit 54b441d690
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

@ -32,13 +32,13 @@ func ErrorOrFinish2(ctx context.Context, c1, c2 <-chan error) error {
select {
case <-ctx.Done():
return ctx.Err()
case err, failed := <-c1:
if failed {
case err := <-c1:
if err != nil {
return err
}
return ErrorOrFinish1(ctx, c2)
case err, failed := <-c2:
if failed {
case err := <-c2:
if err != nil {
return err
}
return ErrorOrFinish1(ctx, c1)

Loading…
Cancel
Save