From 551b4ca9c41d8be7aa5c40ef5b171fa57e9b4942 Mon Sep 17 00:00:00 2001 From: "nelson.parente" Date: Thu, 22 May 2025 13:57:35 +0100 Subject: [PATCH] fix: add multierr collection Signed-off-by: nelson.parente --- bindings/gcp/bucket/bucket.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bindings/gcp/bucket/bucket.go b/bindings/gcp/bucket/bucket.go index 55ffb993c..41bfd13ce 100644 --- a/bindings/gcp/bucket/bucket.go +++ b/bindings/gcp/bucket/bucket.go @@ -32,6 +32,7 @@ import ( "cloud.google.com/go/storage" "github.com/google/uuid" + "go.uber.org/multierr" "google.golang.org/api/googleapi" "google.golang.org/api/iterator" "google.golang.org/api/option" @@ -490,10 +491,13 @@ func (g *GCPStorage) bulkGet(ctx context.Context, req *bindings.InvokeRequest) ( wg.Wait() close(errCh) + var multiErr error for err := range errCh { - if err != nil { - return nil, err - } + multierr.AppendInto(&multiErr, err) + } + + if multiErr != nil { + return nil, multiErr } return &bindings.InvokeResponse{}, nil