multi: repleace ioutil.ReadFile
This commit is contained in:
1 parent
619c8f4eb8
commit
ab83343c87
23 files changed
+55
-62
No files matched your search
@@ -7,7 +7,7 @@ import (
|
||||
"crypto/x509"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/btcsuite/btcd/btcec/v2"
|
||||
@@ -1259,7 +1259,7 @@ func extractSignature(in *psbt.PInput,
|
||||
func connectRPC(hostPort, tlsCertPath, macaroonPath string,
|
||||
timeout time.Duration) (*grpc.ClientConn, error) {
|
||||
|
||||
certBytes, err := ioutil.ReadFile(tlsCertPath)
|
||||
certBytes, err := os.ReadFile(tlsCertPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading TLS cert file %v: %w",
|
||||
tlsCertPath, err)
|
||||
@@ -1271,7 +1271,7 @@ func connectRPC(hostPort, tlsCertPath, macaroonPath string,
|
||||
"certificate")
|
||||
}
|
||||
|
||||
macBytes, err := ioutil.ReadFile(macaroonPath)
|
||||
macBytes, err := os.ReadFile(macaroonPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error reading macaroon file %v: %w",
|
||||
macaroonPath, err)
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -229,7 +229,7 @@ func TestCommitmentAndHTLCTransactions(t *testing.T) {
|
||||
|
||||
var testCases []testCase
|
||||
|
||||
jsonText, err := ioutil.ReadFile(set.jsonFile)
|
||||
jsonText, err := os.ReadFile(set.jsonFile)
|
||||
require.NoError(t, err)
|
||||
|
||||
err = json.Unmarshal(jsonText, &testCases)
|
||||
|
||||
Reference in new issue
Block a user