diff options
Diffstat (limited to 'src/compress/gzip')
-rw-r--r-- | src/compress/gzip/gunzip_test.go | 9 | ||||
-rw-r--r-- | src/compress/gzip/gzip_test.go | 9 | ||||
-rw-r--r-- | src/compress/gzip/issue14937_test.go | 3 |
3 files changed, 10 insertions, 11 deletions
diff --git a/src/compress/gzip/gunzip_test.go b/src/compress/gzip/gunzip_test.go index 1b01404169..17c23e8a9b 100644 --- a/src/compress/gzip/gunzip_test.go +++ b/src/compress/gzip/gunzip_test.go @@ -9,7 +9,6 @@ import ( "compress/flate" "encoding/base64" "io" - "io/ioutil" "os" "strings" "testing" @@ -430,7 +429,7 @@ func TestIssue6550(t *testing.T) { defer gzip.Close() done := make(chan bool, 1) go func() { - _, err := io.Copy(ioutil.Discard, gzip) + _, err := io.Copy(io.Discard, gzip) if err == nil { t.Errorf("Copy succeeded") } else { @@ -467,7 +466,7 @@ Found: const hello = "hello world\n" r.Multistream(false) - data, err := ioutil.ReadAll(&r) + data, err := io.ReadAll(&r) if string(data) != hello || err != nil { t.Fatalf("first stream = %q, %v, want %q, %v", string(data), err, hello, nil) } @@ -476,7 +475,7 @@ Found: t.Fatalf("second reset: %v", err) } r.Multistream(false) - data, err = ioutil.ReadAll(&r) + data, err = io.ReadAll(&r) if string(data) != hello || err != nil { t.Fatalf("second stream = %q, %v, want %q, %v", string(data), err, hello, nil) } @@ -507,7 +506,7 @@ func TestTruncatedStreams(t *testing.T) { } continue } - _, err = io.Copy(ioutil.Discard, r) + _, err = io.Copy(io.Discard, r) if ferr, ok := err.(*flate.ReadError); ok { err = ferr.Err } diff --git a/src/compress/gzip/gzip_test.go b/src/compress/gzip/gzip_test.go index f18c5cb454..12c8e18207 100644 --- a/src/compress/gzip/gzip_test.go +++ b/src/compress/gzip/gzip_test.go @@ -8,7 +8,6 @@ import ( "bufio" "bytes" "io" - "io/ioutil" "reflect" "testing" "time" @@ -29,7 +28,7 @@ func TestEmpty(t *testing.T) { if want := (Header{OS: 255}); !reflect.DeepEqual(r.Header, want) { t.Errorf("Header mismatch:\ngot %#v\nwant %#v", r.Header, want) } - b, err := ioutil.ReadAll(r) + b, err := io.ReadAll(r) if err != nil { t.Fatalf("ReadAll: %v", err) } @@ -62,7 +61,7 @@ func TestRoundTrip(t *testing.T) { if err != nil { t.Fatalf("NewReader: %v", err) } - b, err := ioutil.ReadAll(r) + b, err := io.ReadAll(r) if err != nil { t.Fatalf("ReadAll: %v", err) } @@ -147,7 +146,7 @@ func TestLatin1RoundTrip(t *testing.T) { t.Errorf("NewReader: %v", err) continue } - _, err = ioutil.ReadAll(r) + _, err = io.ReadAll(r) if err != nil { t.Errorf("ReadAll: %v", err) continue @@ -217,7 +216,7 @@ func TestConcat(t *testing.T) { if err != nil { t.Fatal(err) } - data, err := ioutil.ReadAll(r) + data, err := io.ReadAll(r) if string(data) != "hello world\n" || err != nil { t.Fatalf("ReadAll = %q, %v, want %q, nil", data, err, "hello world") } diff --git a/src/compress/gzip/issue14937_test.go b/src/compress/gzip/issue14937_test.go index 7a19672d57..24db3641aa 100644 --- a/src/compress/gzip/issue14937_test.go +++ b/src/compress/gzip/issue14937_test.go @@ -2,6 +2,7 @@ package gzip import ( "internal/testenv" + "io/fs" "os" "path/filepath" "runtime" @@ -30,7 +31,7 @@ func TestGZIPFilesHaveZeroMTimes(t *testing.T) { t.Fatal("error evaluating GOROOT: ", err) } var files []string - err = filepath.Walk(goroot, func(path string, info os.FileInfo, err error) error { + err = filepath.Walk(goroot, func(path string, info fs.FileInfo, err error) error { if err != nil { return err } |