From 4359978ef22a22ddd5a19adf18cbc80cb44244fb Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Thu, 23 Feb 2023 14:28:18 +0100 Subject: all: ioutil is deprecated in go1.19 (#3718) --- pkg/auth/auth.go | 4 ++-- pkg/auth/jwt.go | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'pkg/auth') diff --git a/pkg/auth/auth.go b/pkg/auth/auth.go index af8432a34..a9a66809a 100644 --- a/pkg/auth/auth.go +++ b/pkg/auth/auth.go @@ -29,7 +29,7 @@ package auth import ( "encoding/json" "fmt" - "io/ioutil" + "io" "net/http" "net/url" "strconv" @@ -81,7 +81,7 @@ func (auth *Endpoint) queryTokenInfo(tokenValue string) (*jwtClaims, error) { if resp.StatusCode != http.StatusOK { return nil, fmt.Errorf("verification failed %v", resp.StatusCode) } - body, err := ioutil.ReadAll(resp.Body) + body, err := io.ReadAll(resp.Body) if err != nil { return nil, err } diff --git a/pkg/auth/jwt.go b/pkg/auth/jwt.go index f6d219323..c1f034a2c 100644 --- a/pkg/auth/jwt.go +++ b/pkg/auth/jwt.go @@ -8,7 +8,6 @@ import ( "encoding/json" "fmt" "io" - "io/ioutil" "net/http" "strings" "sync" @@ -65,7 +64,7 @@ func retrieveJwtToken(ctor requestCtor, doer requestDoer) (*expiringToken, error return nil, err } defer resp.Body.Close() - data, err := ioutil.ReadAll(resp.Body) + data, err := io.ReadAll(resp.Body) if err != nil { return nil, err } -- cgit mrf-deployment