Skip to content

Commit

Permalink
forの必要がないため
Browse files Browse the repository at this point in the history
  • Loading branch information
ddddddO committed Jul 20, 2023
1 parent 558cdc3 commit 180b146
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions pipeline_tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,18 @@ func (*treePipeline) handlePipelineErr(ctx context.Context, echs ...<-chan error
for i := range echs {
i := i
eg.Go(func() error {
for {
select {
case err, ok := <-echs[i]:
if !ok {
return nil
}
if err != nil {
return err
}
case <-ectx.Done():
return ectx.Err()
select {
case err, ok := <-echs[i]:
if !ok {
return nil
}
if err != nil {
return err
}
case <-ectx.Done():
return ectx.Err()
}
return nil
})
}
return eg.Wait()
Expand Down

0 comments on commit 180b146

Please sign in to comment.