mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-10-03 20:53:04 +02:00
multi: replace ioutil.WriteFile
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"bytes"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net"
|
||||
"os"
|
||||
"strconv"
|
||||
@@ -193,7 +192,7 @@ func bakeMacaroon(ctx *cli.Context) error {
|
||||
// a file or write to the standard output using hex encoding.
|
||||
switch {
|
||||
case savePath != "":
|
||||
err = ioutil.WriteFile(savePath, macBytes, 0644)
|
||||
err = os.WriteFile(savePath, macBytes, 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -472,7 +471,7 @@ func constrainMacaroon(ctx *cli.Context) error {
|
||||
}
|
||||
|
||||
// Now we can output the result.
|
||||
err = ioutil.WriteFile(destMacFile, destMacBytes, 0644)
|
||||
err = os.WriteFile(destMacFile, destMacBytes, 0644)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error writing destination macaroon file "+
|
||||
"%s: %v", destMacFile, err)
|
||||
|
@@ -6,7 +6,6 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
@@ -244,7 +243,8 @@ func saveProfileFile(file string, f *profileFile) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("could not marshal profile: %w", err)
|
||||
}
|
||||
return ioutil.WriteFile(file, content, 0644)
|
||||
|
||||
return os.WriteFile(file, content, 0644)
|
||||
}
|
||||
|
||||
// profileFile is a struct that represents the whole content of a profile file.
|
||||
|
Reference in New Issue
Block a user