From ddf4dbd0b7096a0d34677047b9c3992bb6ed359b Mon Sep 17 00:00:00 2001 From: Patrick Jones Date: Thu, 12 Aug 2021 15:57:50 -0700 Subject: [PATCH] check error that was unchecked --- google/internal/externalaccount/sts_exchange.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/google/internal/externalaccount/sts_exchange.go b/google/internal/externalaccount/sts_exchange.go index a8a704b..e6fcae5 100644 --- a/google/internal/externalaccount/sts_exchange.go +++ b/google/internal/externalaccount/sts_exchange.go @@ -65,6 +65,9 @@ func exchangeToken(ctx context.Context, endpoint string, request *stsTokenExchan defer resp.Body.Close() body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) + if err != nil { + return nil, err + } if c := resp.StatusCode; c < 200 || c > 299 { return nil, fmt.Errorf("oauth2/google: status code %d: %s", c, body) }