From 88ce035df1a09055c90adf1d2f5bf0c6c978d00c Mon Sep 17 00:00:00 2001 From: THAT ONE GUY <97331552+tuesdayinsighter@users.noreply.github.com> Date: Fri, 17 May 2024 00:28:53 +0800 Subject: [PATCH] ioutil to io (#98) --- links.go | 3 +-- testing/bench_test.go | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/links.go b/links.go index c91679b..632e410 100644 --- a/links.go +++ b/links.go @@ -5,7 +5,6 @@ import ( "bytes" "fmt" "io" - "io/ioutil" "math" cid "github.com/ipfs/go-cid" @@ -115,7 +114,7 @@ func discard(br io.Reader, n int) error { } return err default: - discarded, err := io.CopyN(ioutil.Discard, br, int64(n)) + discarded, err := io.CopyN(io.Discard, br, int64(n)) if discarded != 0 && discarded < int64(n) && err == io.EOF { return io.ErrUnexpectedEOF } diff --git a/testing/bench_test.go b/testing/bench_test.go index 7ed59c8..c8d95d6 100644 --- a/testing/bench_test.go +++ b/testing/bench_test.go @@ -3,7 +3,6 @@ package testing import ( "bytes" "io" - "io/ioutil" "math/rand" "reflect" "testing" @@ -26,7 +25,7 @@ func BenchmarkMarshaling(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { - if err := tt.MarshalCBOR(ioutil.Discard); err != nil { + if err := tt.MarshalCBOR(io.Discard); err != nil { b.Fatal(err) } } @@ -130,7 +129,7 @@ func BenchmarkMapMarshaling(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { - if err := tt.MarshalCBOR(ioutil.Discard); err != nil { + if err := tt.MarshalCBOR(io.Discard); err != nil { b.Fatal(err) } }