Skip to content

Commit c9e5b44

Browse files
committed
whitelist: replace uses of deprecated io/ioutil
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent d7e9e5f commit c9e5b44

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

whitelist/http_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package whitelist
22

33
import (
4-
"io/ioutil"
4+
"io"
55
"log"
66
"net/http"
77
"net/http/httptest"
@@ -31,7 +31,7 @@ func testHTTPResponse(url string, t *testing.T) string {
3131
t.Fatalf("%v", err)
3232
}
3333

34-
body, err := ioutil.ReadAll(resp.Body)
34+
body, err := io.ReadAll(resp.Body)
3535
if err != nil {
3636
t.Fatalf("%v", err)
3737
}

whitelist/whitelist_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"bytes"
55
"encoding/json"
66
"errors"
7-
"io/ioutil"
7+
"io"
88
"log"
99
"net"
1010
"net/http"
@@ -199,7 +199,7 @@ func TestNetConn(t *testing.T) {
199199
if err != nil {
200200
t.Fatalf("%v", err)
201201
}
202-
body, err := ioutil.ReadAll(conn)
202+
body, err := io.ReadAll(conn)
203203
if err != nil {
204204
t.Fatalf("%v", err)
205205
}
@@ -213,7 +213,7 @@ func TestNetConn(t *testing.T) {
213213
if err != nil {
214214
t.Fatalf("%v", err)
215215
}
216-
body, err = ioutil.ReadAll(conn)
216+
body, err = io.ReadAll(conn)
217217
if err != nil {
218218
t.Fatalf("%v", err)
219219
}

0 commit comments

Comments
 (0)