multi: replace ioutil.ReadDir

This commit is contained in:
erik 2023-06-14 11:43:51 +02:00 committed by ErikEk
parent c7f81d3142
commit caf2419ff6
3 changed files with 3 additions and 5 deletions

View File

@ -7,7 +7,6 @@ import (
"encoding/hex"
"errors"
"fmt"
"io/ioutil"
"os"
"strings"
@ -135,7 +134,7 @@ func NewBackend(miner string, netParams *chaincfg.Params) (
// the log files, including any compressed log files from
// logrorate, before deleting the temporary log dir.
logDir := fmt.Sprintf("%s/%s", baseLogDir, netParams.Name)
files, err := ioutil.ReadDir(logDir)
files, err := os.ReadDir(logDir)
if err != nil {
errStr += fmt.Sprintf(
"unable to read log directory: %v\n", err,

View File

@ -4,7 +4,6 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
@ -121,7 +120,7 @@ func (h *HarnessMiner) saveLogs() {
// After shutting down the miner, we'll make a copy of the log files
// before deleting the temporary log dir.
path := fmt.Sprintf("%s/%s", h.logPath, harnessNetParams.Name)
files, err := ioutil.ReadDir(path)
files, err := os.ReadDir(path)
require.NoError(h, err, "unable to read log directory")
for _, file := range files {

View File

@ -1032,7 +1032,7 @@ func addLogFile(hn *HarnessNode) error {
// copyAll copies all files and directories from srcDir to dstDir recursively.
// Note that this function does not support links.
func copyAll(dstDir, srcDir string) error {
entries, err := ioutil.ReadDir(srcDir)
entries, err := os.ReadDir(srcDir)
if err != nil {
return err
}