Skip to content

Commit 4283bc5

Browse files
committed
Switch back to ioutil
1 parent fdcd40d commit 4283bc5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

client.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"context"
66
"encoding/json"
77
"io"
8+
"io/ioutil"
89
"net/http"
910
"net/url"
1011
"time"
@@ -69,9 +70,9 @@ func (c *Client) setBody(req *http.Request, in interface{}) error {
6970
if err != nil {
7071
return err
7172
}
72-
req.Body = io.NopCloser(bytes.NewReader(buf))
73+
req.Body = ioutil.NopCloser(bytes.NewReader(buf))
7374
req.GetBody = func() (io.ReadCloser, error) {
74-
return io.NopCloser(bytes.NewReader(buf)), nil
75+
return ioutil.NopCloser(bytes.NewReader(buf)), nil
7576
}
7677
req.Header.Set("Content-Type", "application/json")
7778
req.ContentLength = int64(len(buf))
@@ -106,7 +107,7 @@ func (c *Client) do(ctx context.Context, method, path string, in, out interface{
106107
return nil
107108
}
108109

109-
buf, _ := io.ReadAll(res.Body)
110+
buf, _ := ioutil.ReadAll(res.Body)
110111
apiErr := &APIError{Status: res.Status, StatusCode: res.StatusCode}
111112
if json.Unmarshal(buf, &apiErrorResponse{Error: apiErr}) != nil {
112113
apiErr.Message = string(buf)

0 commit comments

Comments
 (0)