From 1987f271f9cc1dad5580a48915136b76d76bd9c0 Mon Sep 17 00:00:00 2001 From: Angira Kekteeva Date: Tue, 9 Aug 2022 16:37:08 +0400 Subject: [PATCH] [#577] Remove usages of deprecated io/ioutil Signed-off-by: Angira Kekteeva --- api/auth/signer/v4/v4.go | 3 +-- api/layer/object_test.go | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/api/auth/signer/v4/v4.go b/api/auth/signer/v4/v4.go index f65a239..4680cc8 100644 --- a/api/auth/signer/v4/v4.go +++ b/api/auth/signer/v4/v4.go @@ -60,7 +60,6 @@ import ( "encoding/hex" "fmt" "io" - "io/ioutil" "net/http" "net/url" "sort" @@ -367,7 +366,7 @@ func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, regi if body != nil { var ok bool if reader, ok = body.(io.ReadCloser); !ok { - reader = ioutil.NopCloser(body) + reader = io.NopCloser(body) } } r.Body = reader diff --git a/api/layer/object_test.go b/api/layer/object_test.go index ec4475e..dab69a4 100644 --- a/api/layer/object_test.go +++ b/api/layer/object_test.go @@ -4,7 +4,7 @@ import ( "bytes" "crypto/rand" "crypto/sha256" - "io/ioutil" + "io" "testing" "github.com/stretchr/testify/require" @@ -22,7 +22,7 @@ func TestWrapReader(t *testing.T) { streamHash.Write(buf) }) - dst, err := ioutil.ReadAll(wrappedReader) + dst, err := io.ReadAll(wrappedReader) require.NoError(t, err) require.Equal(t, src, dst) require.Equal(t, h[:], streamHash.Sum(nil))