summaryrefslogtreecommitdiff
path: root/src/compress/flate/deflate_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-10-16 00:49:02 -0400
committerRuss Cox <rsc@golang.org>2020-10-20 18:41:18 +0000
commit1b09d430678d4a6f73b2443463d11f75851aba8a (patch)
treefec040abfc6e1d897f8dcdbb856e77d5bccbb2ca /src/compress/flate/deflate_test.go
parentcb0a0f52e67f128c6ad69027c9a8c7a5caf58446 (diff)
downloadgo-git-1b09d430678d4a6f73b2443463d11f75851aba8a.tar.gz
all: update references to symbols moved from io/ioutil to io
The old ioutil references are still valid, but update our code to reflect best practices and get used to the new locations. Code compiled with the bootstrap toolchain (cmd/asm, cmd/dist, cmd/compile, debug/elf) must remain Go 1.4-compatible and is excluded. Also excluded vendored code. For #41190. Change-Id: I6d86f2bf7bc37a9d904b6cee3fe0c7af6d94d5b1 Reviewed-on: https://go-review.googlesource.com/c/go/+/263142 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
Diffstat (limited to 'src/compress/flate/deflate_test.go')
-rw-r--r--src/compress/flate/deflate_test.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/compress/flate/deflate_test.go b/src/compress/flate/deflate_test.go
index b19cbec5a9..6fc5abf4d5 100644
--- a/src/compress/flate/deflate_test.go
+++ b/src/compress/flate/deflate_test.go
@@ -157,7 +157,7 @@ func TestVeryLongSparseChunk(t *testing.T) {
if testing.Short() {
t.Skip("skipping sparse chunk during short test")
}
- w, err := NewWriter(ioutil.Discard, 1)
+ w, err := NewWriter(io.Discard, 1)
if err != nil {
t.Errorf("NewWriter: %v", err)
return
@@ -294,7 +294,7 @@ func testSync(t *testing.T, level int, input []byte, name string) {
// stream should work for ordinary reader too
r = NewReader(buf1)
- out, err = ioutil.ReadAll(r)
+ out, err = io.ReadAll(r)
if err != nil {
t.Errorf("testSync: read: %s", err)
return
@@ -322,7 +322,7 @@ func testToFromWithLevelAndLimit(t *testing.T, level int, input []byte, name str
t.Logf("level: %d, size:%.2f%%, %d b\n", level, float64(buffer.Len()*100)/float64(limit), buffer.Len())
}
r := NewReader(&buffer)
- out, err := ioutil.ReadAll(r)
+ out, err := io.ReadAll(r)
if err != nil {
t.Errorf("read: %s", err)
return
@@ -415,7 +415,7 @@ func TestReaderDict(t *testing.T) {
w.Close()
r := NewReaderDict(&b, []byte(dict))
- data, err := ioutil.ReadAll(r)
+ data, err := io.ReadAll(r)
if err != nil {
t.Fatal(err)
}
@@ -456,7 +456,7 @@ func TestRegression2508(t *testing.T) {
t.Logf("test disabled with -short")
return
}
- w, err := NewWriter(ioutil.Discard, 1)
+ w, err := NewWriter(io.Discard, 1)
if err != nil {
t.Fatalf("NewWriter: %v", err)
}
@@ -475,7 +475,7 @@ func TestWriterReset(t *testing.T) {
if testing.Short() && level > 1 {
break
}
- w, err := NewWriter(ioutil.Discard, level)
+ w, err := NewWriter(io.Discard, level)
if err != nil {
t.Fatalf("NewWriter: %v", err)
}
@@ -487,9 +487,9 @@ func TestWriterReset(t *testing.T) {
for i := 0; i < n; i++ {
w.Write(buf)
}
- w.Reset(ioutil.Discard)
+ w.Reset(io.Discard)
- wref, err := NewWriter(ioutil.Discard, level)
+ wref, err := NewWriter(io.Discard, level)
if err != nil {
t.Fatalf("NewWriter: %v", err)
}
@@ -654,7 +654,7 @@ func TestBestSpeed(t *testing.T) {
}
r := NewReader(buf)
- got, err := ioutil.ReadAll(r)
+ got, err := io.ReadAll(r)
if err != nil {
t.Errorf("i=%d, firstN=%d, flush=%t: ReadAll: %v", i, firstN, flush, err)
continue
@@ -881,7 +881,7 @@ func TestBestSpeedMaxMatchOffset(t *testing.T) {
}
r := NewReader(buf)
- dst, err := ioutil.ReadAll(r)
+ dst, err := io.ReadAll(r)
r.Close()
if err != nil {
report("ReadAll: ", err)
@@ -968,7 +968,7 @@ func TestMaxStackSize(t *testing.T) {
wg.Add(1)
go func(level int) {
defer wg.Done()
- zw, err := NewWriter(ioutil.Discard, level)
+ zw, err := NewWriter(io.Discard, level)
if err != nil {
t.Errorf("level %d, NewWriter() = %v, want nil", level, err)
}
@@ -978,7 +978,7 @@ func TestMaxStackSize(t *testing.T) {
if err := zw.Close(); err != nil {
t.Errorf("level %d, Close() = %v, want nil", level, err)
}
- zw.Reset(ioutil.Discard)
+ zw.Reset(io.Discard)
}(level)
}
}