chore: remove refs to deprecated io/ioutil (#8557)

This commit is contained in:
guangwu 2023-11-13 17:32:14 +08:00 committed by GitHub
parent 97e94f6d2c
commit 887dd255ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -6,14 +6,14 @@ import (
"github.com/ledgerwatch/erigon/cl/phase1/core/state"
"github.com/ledgerwatch/erigon/cl/utils"
"io/fs"
"io/ioutil"
"os"
"path"
"path/filepath"
"sort"
)
func (r *RegressionTester) readStartingState() (*state.CachingBeaconState, error) {
stateFile, err := ioutil.ReadFile(path.Join(r.testDirectory, regressionPath, startingStatePath))
stateFile, err := os.ReadFile(path.Join(r.testDirectory, regressionPath, startingStatePath))
if err != nil {
return nil, err
}
@ -33,7 +33,7 @@ func (r *RegressionTester) initBlocks() error {
if info == nil || info.IsDir() || info.Name() != "data.bin" {
return nil
}
f, err := ioutil.ReadFile(path)
f, err := os.ReadFile(path)
if err != nil {
return err
}

View File

@ -5,7 +5,6 @@ import (
"encoding/binary"
"errors"
"fmt"
"io/ioutil"
"net"
"os"
"path/filepath"
@ -24,7 +23,7 @@ var ErrInvalidEnodeString = errors.New("invalid enode string")
func ClearDevDB(dataDir string, logger log.Logger) error {
logger.Info("Deleting nodes' data folders")
files, err := ioutil.ReadDir(dataDir)
files, err := os.ReadDir(dataDir)
if err != nil {
return err