mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-18 21:35:24 +01:00
multi: replace ioutil.ReadDir
This commit is contained in:
parent
c7f81d3142
commit
caf2419ff6
@ -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,
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user