From a33cedf891646178858d9fe9b04f1c22a1b79d99 Mon Sep 17 00:00:00 2001 From: Andi <36215014+ChengenH@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:15:21 +0800 Subject: [PATCH] remove deprecated of package io/ioutil (#13067) Signed-off-by: ChengenH --- cl/antiquary/antiquary.go | 4 ++-- erigon-lib/log/v3/bench_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cl/antiquary/antiquary.go b/cl/antiquary/antiquary.go index 22a42c16aab..660b5184fd9 100644 --- a/cl/antiquary/antiquary.go +++ b/cl/antiquary/antiquary.go @@ -18,8 +18,8 @@ package antiquary import ( "context" - "io/ioutil" "math" + "os" "strings" "sync/atomic" "time" @@ -101,7 +101,7 @@ func NewAntiquary(ctx context.Context, blobStorage blob_storage.BlobStorage, gen // Check if the snapshot directory has beacon blocks files aka "contains beaconblock" and has a ".seg" extension over its first layer func doesSnapshotDirHaveBeaconBlocksFiles(snapshotDir string) bool { // Iterate over the files in the snapshot directory - files, err := ioutil.ReadDir(snapshotDir) + files, err := os.ReadDir(snapshotDir) if err != nil { return false } diff --git a/erigon-lib/log/v3/bench_test.go b/erigon-lib/log/v3/bench_test.go index 92b0fc8f0dc..738b9b0bb00 100644 --- a/erigon-lib/log/v3/bench_test.go +++ b/erigon-lib/log/v3/bench_test.go @@ -3,7 +3,7 @@ package log import ( "bytes" "errors" - "io/ioutil" + "io" "testing" "time" ) @@ -134,7 +134,7 @@ func BenchmarkDescendant8(b *testing.B) { // (MIT License) func newLog15() Logger { logger := New() - logger.SetHandler(StreamHandler(ioutil.Discard, JsonFormat())) + logger.SetHandler(StreamHandler(io.Discard, JsonFormat())) return logger }