Skip to content

Commit

Permalink
Return a closed channel instead of nil for getChannelOrErrorParallel
Browse files Browse the repository at this point in the history
  • Loading branch information
mathew-cf committed Dec 2, 2022
1 parent 9a4b5a5 commit e570450
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compparallel.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@ func getChannelOrErrorParallel[T any](
select {
case err, ok := <-errCh:
if !ok {
return nil, routing.ErrNotFound
return outCh, routing.ErrNotFound
}
return nil, err
return outCh, err
case <-ctx.Done():
return nil, ctx.Err()
return outCh, ctx.Err()
default:
return outCh, nil
}
Expand Down

0 comments on commit e570450

Please sign in to comment.