Skip to content

Commit 3c86686

Browse files
authored
Remove dependency on a deprecated package (#119)
1 parent f27f379 commit 3c86686

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

client/nginx.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"errors"
88
"fmt"
99
"io"
10-
"io/ioutil"
1110
"net/http"
1211
"reflect"
1312
"strings"
@@ -553,7 +552,7 @@ func getAPIVersions(httpClient *http.Client, endpoint string) (*versions, error)
553552
return nil, fmt.Errorf("%v is not accessible: expected %v response, got %v", endpoint, http.StatusOK, resp.StatusCode)
554553
}
555554

556-
body, err := ioutil.ReadAll(resp.Body)
555+
body, err := io.ReadAll(resp.Body)
557556
if err != nil {
558557
return nil, fmt.Errorf("error while reading body of the response: %w", err)
559558
}
@@ -582,7 +581,7 @@ func createResponseMismatchError(respBody io.ReadCloser) *internalError {
582581
}
583582

584583
func readAPIErrorResponse(respBody io.ReadCloser) (*apiErrorResponse, error) {
585-
body, err := ioutil.ReadAll(respBody)
584+
body, err := io.ReadAll(respBody)
586585
if err != nil {
587586
return nil, fmt.Errorf("failed to read the response body: %w", err)
588587
}
@@ -812,7 +811,7 @@ func (client *NginxClient) get(path string, data interface{}) error {
812811
}
813812
defer resp.Body.Close()
814813

815-
body, err := ioutil.ReadAll(resp.Body)
814+
body, err := io.ReadAll(resp.Body)
816815
if err != nil {
817816
return fmt.Errorf("failed to read the response body: %w", err)
818817
}

0 commit comments

Comments
 (0)