mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-17 23:06:30 -05:00
simplify error propagation
This commit is contained in:
parent
bf64c449de
commit
54b441d690
@ -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…
Reference in New Issue
Block a user