Skip to content

Commit 52d7ca9

Browse files
committed
internal: resolve ioutil deprecations
1 parent 955581b commit 52d7ca9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"encoding/binary"
66
"encoding/json"
77
"fmt"
8-
"io/ioutil"
8+
"io"
99
"math"
1010
"net"
1111
"net/http"
@@ -47,7 +47,7 @@ func (c Client) Get(path string) (string, error) {
4747
defer res.Body.Close()
4848
}
4949

50-
body, err := ioutil.ReadAll(res.Body)
50+
body, err := io.ReadAll(res.Body)
5151
if err != nil {
5252
return "", err
5353
}
@@ -75,7 +75,7 @@ func (c Client) Put(path string, body []byte) (string, error) {
7575
req.Header.Set("Content-Type", "application/json")
7676
req.Header.Set("Accept", "application/json")
7777

78-
req.Body = ioutil.NopCloser(bytes.NewReader(body))
78+
req.Body = io.NopCloser(bytes.NewReader(body))
7979

8080
res, err := c.client.Do(req)
8181
if err != nil {
@@ -86,7 +86,7 @@ func (c Client) Put(path string, body []byte) (string, error) {
8686
defer res.Body.Close()
8787
}
8888

89-
responseBody, err := ioutil.ReadAll(res.Body)
89+
responseBody, err := io.ReadAll(res.Body)
9090
if err != nil {
9191
return "", err
9292
}

0 commit comments

Comments
 (0)