multi: repleace ioutil.ReadFile

This commit is contained in:
erik
2023-06-13 21:22:44 +07:00
committed by ErikEk
parent 619c8f4eb8
commit ab83343c87
23 changed files with 55 additions and 62 deletions

View File

@@ -9,7 +9,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"net"
"os"
"os/user"
@@ -1846,7 +1845,7 @@ func parseRPCParams(cConfig *lncfg.Chain, nodeConfig interface{},
// We convert the cookie into a user name and password.
if conf.RPCCookie != "" {
cookie, err := ioutil.ReadFile(conf.RPCCookie)
cookie, err := os.ReadFile(conf.RPCCookie)
if err != nil {
return fmt.Errorf("cannot read cookie file: %w",
err)
@@ -2119,7 +2118,7 @@ func extractBitcoindRPCParams(networkName, bitcoindDataDir, bitcoindConfigPath,
if rpcCookiePath != "" {
cookiePath = rpcCookiePath
}
cookie, err := ioutil.ReadFile(cookiePath)
cookie, err := os.ReadFile(cookiePath)
if err == nil {
splitCookie := strings.Split(string(cookie), ":")
if len(splitCookie) == 2 {