aboutsummaryrefslogtreecommitdiff
path: root/src/net/http/sniff_test.go
diff options
context:
space:
mode:
authorKatie Hockman <katie@golang.org>2020-12-14 10:03:05 -0500
committerKatie Hockman <katie@golang.org>2020-12-14 10:06:13 -0500
commit0345ede87ee12698988973884cfc0fd3d499dffd (patch)
tree7123cff141ee5661208d2f5f437b8f5252ac7f6a /src/net/http/sniff_test.go
parent4651d6b267818b0e0d128a5443289717c4bb8cbc (diff)
parent0a02371b0576964e81c3b40d328db9a3ef3b031b (diff)
downloadgo-0345ede87ee12698988973884cfc0fd3d499dffd.tar.xz
[dev.fuzz] all: merge master into dev.fuzz
Change-Id: I5d8c8329ccc9d747bd81ade6b1cb7cb8ae2e94b2
Diffstat (limited to 'src/net/http/sniff_test.go')
-rw-r--r--src/net/http/sniff_test.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/net/http/sniff_test.go b/src/net/http/sniff_test.go
index a1157a0823..8d5350374d 100644
--- a/src/net/http/sniff_test.go
+++ b/src/net/http/sniff_test.go
@@ -8,7 +8,6 @@ import (
"bytes"
"fmt"
"io"
- "io/ioutil"
"log"
. "net/http"
"reflect"
@@ -123,7 +122,7 @@ func testServerContentType(t *testing.T, h2 bool) {
if ct := resp.Header.Get("Content-Type"); ct != wantContentType {
t.Errorf("%v: Content-Type = %q, want %q", tt.desc, ct, wantContentType)
}
- data, err := ioutil.ReadAll(resp.Body)
+ data, err := io.ReadAll(resp.Body)
if err != nil {
t.Errorf("%v: reading body: %v", tt.desc, err)
} else if !bytes.Equal(data, tt.data) {
@@ -185,7 +184,7 @@ func testContentTypeWithCopy(t *testing.T, h2 bool) {
if ct := resp.Header.Get("Content-Type"); ct != expected {
t.Errorf("Content-Type = %q, want %q", ct, expected)
}
- data, err := ioutil.ReadAll(resp.Body)
+ data, err := io.ReadAll(resp.Body)
if err != nil {
t.Errorf("reading body: %v", err)
} else if !bytes.Equal(data, []byte(input)) {
@@ -216,7 +215,7 @@ func testSniffWriteSize(t *testing.T, h2 bool) {
if err != nil {
t.Fatalf("size %d: %v", size, err)
}
- if _, err := io.Copy(ioutil.Discard, res.Body); err != nil {
+ if _, err := io.Copy(io.Discard, res.Body); err != nil {
t.Fatalf("size %d: io.Copy of body = %v", size, err)
}
if err := res.Body.Close(); err != nil {