Skip to content

Commit db53078

Browse files
authored
Fix ioutil deprecation (#110)
1 parent e21dc4a commit db53078

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/api/test/utils.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package test
77
import (
88
"bytes"
99
"encoding/json"
10-
"io/ioutil"
10+
"io"
1111
"net/http/httptest"
1212
"testing"
1313

@@ -52,7 +52,7 @@ type RequestBody struct {
5252

5353
// JSONObject retrieves a JSON object from a ResponseRecorder into a struct or fails the test.
5454
func JSONObject(t *testing.T, rec *httptest.ResponseRecorder, field string, element interface{}) {
55-
body, err := ioutil.ReadAll(rec.Body)
55+
body, err := io.ReadAll(rec.Body)
5656
if err != nil {
5757
t.Error(err)
5858
}

0 commit comments

Comments
 (0)