From 7effc377a1892efba1aca8166ba98d6f78a5e554 Mon Sep 17 00:00:00 2001 From: Francesco Mari Date: Tue, 16 Apr 2024 21:39:15 +0200 Subject: [PATCH] Upgrade to Go 1.20 (#29) --- .github/workflows/ci.yml | 3 +-- go.mod | 2 +- go.sum | 2 -- ims/client.go | 5 +++-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 67c9f65..da1f83b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,10 +14,9 @@ jobs: strategy: matrix: go-version: - - "1.18" - - "1.19" - "1.20" - "1.21" + - "1.22" steps: - name: Install Go uses: actions/setup-go@v4 diff --git a/go.mod b/go.mod index 414cac4..129f467 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,6 @@ module github.com/adobe/ims-go -go 1.18 +go 1.20 require github.com/golang-jwt/jwt/v5 v5.2.1 diff --git a/go.sum b/go.sum index 10bcec6..f56d3e6 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,2 @@ -github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= -github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= diff --git a/ims/client.go b/ims/client.go index 4181b8d..0d658a8 100644 --- a/ims/client.go +++ b/ims/client.go @@ -11,6 +11,7 @@ package ims import ( + "errors" "fmt" "io" "net/http" @@ -87,8 +88,8 @@ func (c *Client) do(req *http.Request) (_ *Response, e error) { } defer func() { - if err := res.Body.Close(); err != nil && e == nil { - e = fmt.Errorf("close body: %v", err) + if err := res.Body.Close(); err != nil { + e = errors.Join(e, fmt.Errorf("close body: %v", err)) } }()