multi: replace ioutil.WriteFile
This commit is contained in:
1 parent
ab83343c87
commit
789c6bac8c
13 files changed
+20
-31
No files matched your search
@@ -7,7 +7,6 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync"
|
||||
@@ -153,7 +152,7 @@ func New(cfg *Config) (*Server, lnrpc.MacaroonPerms, error) {
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
err = ioutil.WriteFile(macFilePath, chainNotifierMacBytes, 0644)
|
||||
err = os.WriteFile(macFilePath, chainNotifierMacBytes, 0644)
|
||||
if err != nil {
|
||||
_ = os.Remove(macFilePath)
|
||||
return nil, nil, err
|
||||
|
||||
@@ -7,7 +7,6 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@@ -132,7 +131,7 @@ func New(cfg *Config) (*Server, lnrpc.MacaroonPerms, error) {
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
err = ioutil.WriteFile(macFilePath, invoicesMacBytes, 0644)
|
||||
err = os.WriteFile(macFilePath, invoicesMacBytes, 0644)
|
||||
if err != nil {
|
||||
_ = os.Remove(macFilePath)
|
||||
return nil, nil, err
|
||||
|
||||
@@ -6,7 +6,6 @@ import (
|
||||
crand "crypto/rand"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync/atomic"
|
||||
@@ -216,7 +215,7 @@ func New(cfg *Config) (*Server, lnrpc.MacaroonPerms, error) {
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
err = ioutil.WriteFile(macFilePath, routerMacBytes, 0644)
|
||||
err = os.WriteFile(macFilePath, routerMacBytes, 0644)
|
||||
if err != nil {
|
||||
_ = os.Remove(macFilePath)
|
||||
return nil, nil, err
|
||||
|
||||
@@ -8,7 +8,6 @@ import (
|
||||
"context"
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@@ -167,7 +166,7 @@ func New(cfg *Config) (*Server, lnrpc.MacaroonPerms, error) {
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
err = ioutil.WriteFile(macFilePath, signerMacBytes, 0644)
|
||||
err = os.WriteFile(macFilePath, signerMacBytes, 0644)
|
||||
if err != nil {
|
||||
_ = os.Remove(macFilePath)
|
||||
return nil, nil, err
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"encoding/binary"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -289,7 +288,7 @@ func New(cfg *Config) (*WalletKit, lnrpc.MacaroonPerms, error) {
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
err = ioutil.WriteFile(macFilePath, walletKitMacBytes, 0644)
|
||||
err = os.WriteFile(macFilePath, walletKitMacBytes, 0644)
|
||||
if err != nil {
|
||||
_ = os.Remove(macFilePath)
|
||||
return nil, nil, err
|
||||
|
||||
Reference in new issue
Block a user