From 180b1467c19e6fec3259e02e9bfeeb87e43136de Mon Sep 17 00:00:00 2001 From: ddddddO Date: Thu, 20 Jul 2023 22:47:38 +0900 Subject: [PATCH] =?UTF-8?q?for=E3=81=AE=E5=BF=85=E8=A6=81=E3=81=8C?= =?UTF-8?q?=E3=81=AA=E3=81=84=E3=81=9F=E3=82=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_tree.go | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/pipeline_tree.go b/pipeline_tree.go index 1ec8d48..36a6f44 100644 --- a/pipeline_tree.go +++ b/pipeline_tree.go @@ -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()