mirror of
https://github.com/vbatts/tar-split.git
synced 2025-08-02 12:20:28 +00:00
chore: remove refs to deprecated io/ioutil
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
parent
f966b14096
commit
919f9abf38
12 changed files with 26 additions and 37 deletions
|
@ -7,7 +7,6 @@ import (
|
|||
"fmt"
|
||||
"hash/crc64"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
|
@ -232,7 +231,7 @@ func BenchmarkAsm(b *testing.B) {
|
|||
b.Fatal(err)
|
||||
}
|
||||
// read it all to the bit bucket
|
||||
i1, err := io.Copy(ioutil.Discard, tarStream)
|
||||
i1, err := io.Copy(io.Discard, tarStream)
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
|
@ -243,7 +242,7 @@ func BenchmarkAsm(b *testing.B) {
|
|||
|
||||
rc := NewOutputTarStream(fgp, sup)
|
||||
|
||||
i2, err := io.Copy(ioutil.Discard, rc)
|
||||
i2, err := io.Copy(io.Discard, rc)
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"archive/tar"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
|
@ -52,14 +51,14 @@ func TestLargeJunkPadding(t *testing.T) {
|
|||
}()
|
||||
|
||||
// Disassemble our junk file.
|
||||
nilPacker := storage.NewJSONPacker(ioutil.Discard)
|
||||
nilPacker := storage.NewJSONPacker(io.Discard)
|
||||
rdr, err := NewInputTarStream(pR, nilPacker, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Copy the entire rdr.
|
||||
_, err = io.Copy(ioutil.Discard, rdr)
|
||||
_, err = io.Copy(io.Discard, rdr)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package storage
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
@ -31,7 +31,7 @@ func TestGetter(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
buf, err := ioutil.ReadAll(r)
|
||||
buf, err := io.ReadAll(r)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"bytes"
|
||||
"compress/gzip"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
@ -186,7 +185,7 @@ func BenchmarkGetPut(b *testing.B) {
|
|||
b.RunParallel(func(pb *testing.PB) {
|
||||
for pb.Next() {
|
||||
func() {
|
||||
fh, err := ioutil.TempFile("", "tar-split.")
|
||||
fh, err := os.CreateTemp("", "tar-split.")
|
||||
if err != nil {
|
||||
b.Fatal(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue