Skip to content

Commit 6102638

Browse files
author
Lapp
committed
project: change deprecated package: ioutil>io
1 parent 251c8d6 commit 6102638

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pocket.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"context"
66
"encoding/json"
77
"fmt"
8-
"io/ioutil"
8+
"io"
99
"net/http"
1010
"time"
1111

@@ -194,7 +194,7 @@ func (c *Client) doHTTP(ctx context.Context, endpoint string, body interface{})
194194
return gjson.Result{}, fmt.Errorf("API error %s: %s", resp.Header.Get(xErrorCodeHeader), resp.Header.Get(xErrorHeader))
195195
}
196196

197-
respBody, err := ioutil.ReadAll(resp.Body)
197+
respBody, err := io.ReadAll(resp.Body)
198198
if err != nil {
199199
return gjson.Result{}, fmt.Errorf("an error occurred when reading the request body: %s", err.Error())
200200
}

pocket_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package go_pocket_sdk
33
import (
44
"context"
55
"fmt"
6-
"io/ioutil"
6+
"io"
77
"net/http"
88
"strings"
99
"testing"
@@ -27,7 +27,7 @@ func newClient(t *testing.T, statusCode int, path, responseBody string) *Client
2727

2828
return &http.Response{
2929
StatusCode: statusCode,
30-
Body: ioutil.NopCloser(strings.NewReader(responseBody)),
30+
Body: io.NopCloser(strings.NewReader(responseBody)),
3131
}, nil
3232
}),
3333
},

0 commit comments

Comments
 (0)