diff --git a/rgw/admin/radosgw.go b/rgw/admin/radosgw.go index c35b804..9847939 100644 --- a/rgw/admin/radosgw.go +++ b/rgw/admin/radosgw.go @@ -3,7 +3,7 @@ package admin import ( "bytes" "context" - "io/ioutil" + "io" "net/http" "net/url" "time" @@ -98,12 +98,12 @@ func (api *API) call(ctx context.Context, httpMethod, path string, args url.Valu defer resp.Body.Close() // Decode HTTP response - decodedResponse, err := ioutil.ReadAll(resp.Body) + decodedResponse, err := io.ReadAll(resp.Body) if err != nil { return nil, err } - resp.Body = ioutil.NopCloser(bytes.NewBuffer(decodedResponse)) + resp.Body = io.NopCloser(bytes.NewBuffer(decodedResponse)) // Handle error in response if resp.StatusCode >= 300 { diff --git a/rgw/admin/subuser_test.go b/rgw/admin/subuser_test.go index b023e15..0bf302b 100644 --- a/rgw/admin/subuser_test.go +++ b/rgw/admin/subuser_test.go @@ -4,7 +4,7 @@ import ( "bytes" "context" "fmt" - "io/ioutil" + "io" "net/http" "testing" @@ -57,7 +57,7 @@ func TestCreateSubuserMockAPI(t *testing.T) { // mockClient is defined in user_test.go func returnMockClientCreateSubuser() *mockClient { - r := ioutil.NopCloser(bytes.NewReader([]byte(""))) + r := io.NopCloser(bytes.NewReader([]byte(""))) return &mockClient{ mockDo: func(req *http.Request) (*http.Response, error) { if req.Method == http.MethodPut && req.URL.Path == "127.0.0.1/admin/user" { diff --git a/rgw/admin/user_test.go b/rgw/admin/user_test.go index 0165cd2..4df6e33 100644 --- a/rgw/admin/user_test.go +++ b/rgw/admin/user_test.go @@ -6,7 +6,7 @@ import ( "encoding/json" "errors" "fmt" - "io/ioutil" + "io" "net/http" "os" "testing" @@ -248,7 +248,7 @@ func TestGetUserMockAPI(t *testing.T) { } func returnMockClient() *mockClient { - r := ioutil.NopCloser(bytes.NewReader(fakeUserResponse)) + r := io.NopCloser(bytes.NewReader(fakeUserResponse)) return &mockClient{ mockDo: func(req *http.Request) (*http.Response, error) { if req.Method == http.MethodGet && req.URL.Path == "127.0.0.1/admin/user" {