From 31b5eb597d97b86c0b464e6144b63d0050b3a82b Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 24 May 2022 18:52:30 +0900 Subject: [PATCH] Avoid io/ioutil --- integration-tests/nghttpx_http2_test.go | 3 +-- integration-tests/server_tester.go | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/integration-tests/nghttpx_http2_test.go b/integration-tests/nghttpx_http2_test.go index f31f1878..6db9bd5d 100644 --- a/integration-tests/nghttpx_http2_test.go +++ b/integration-tests/nghttpx_http2_test.go @@ -8,7 +8,6 @@ import ( "golang.org/x/net/http2" "golang.org/x/net/http2/hpack" "io" - "io/ioutil" "net" "net/http" "regexp" @@ -601,7 +600,7 @@ func TestH2H1ChunkedRequestBody(t *testing.T) { if got := fmt.Sprint(r.TransferEncoding); got != want { t.Errorf("Transfer-Encoding: %v; want %v", got, want) } - body, err := ioutil.ReadAll(r.Body) + body, err := io.ReadAll(r.Body) if err != nil { t.Fatalf("Error reading r.body: %v", err) } diff --git a/integration-tests/server_tester.go b/integration-tests/server_tester.go index 113e27d1..2522659e 100644 --- a/integration-tests/server_tester.go +++ b/integration-tests/server_tester.go @@ -12,7 +12,6 @@ import ( "golang.org/x/net/http2/hpack" "golang.org/x/net/websocket" "io" - "io/ioutil" "net" "net/http" "net/http/httptest" @@ -430,7 +429,7 @@ func (st *serverTester) http1(rp requestParam) (*serverResponse, error) { if err != nil { return nil, err } - respBody, err := ioutil.ReadAll(resp.Body) + respBody, err := io.ReadAll(resp.Body) if err != nil { return nil, err } @@ -664,7 +663,7 @@ func cloneHeader(h http.Header) http.Header { } func noopHandler(w http.ResponseWriter, r *http.Request) { - ioutil.ReadAll(r.Body) + io.ReadAll(r.Body) } type APIResponse struct {