[#1684] *: Fix linter warnings
Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
parent
67af4c89a8
commit
f8b106ac85
5 changed files with 9 additions and 11 deletions
|
@ -2,7 +2,6 @@ package morph
|
|||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
@ -56,7 +55,7 @@ func TestInitialize(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
|
||||
protoPath := filepath.Join(walletDir, "proto.yml")
|
||||
require.NoError(t, ioutil.WriteFile(protoPath, data, os.ModePerm))
|
||||
require.NoError(t, os.WriteFile(protoPath, data, os.ModePerm))
|
||||
|
||||
v.Set(protoConfigPath, protoPath)
|
||||
// Set to the path or remove the next statement to download from the network.
|
||||
|
|
|
@ -4,7 +4,7 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
internalclient "github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/client"
|
||||
|
@ -103,7 +103,7 @@ func createToken(cmd *cobra.Command, _ []string) {
|
|||
eaclPath, _ := cmd.Flags().GetString(eaclFlag)
|
||||
if eaclPath != "" {
|
||||
table := eaclSDK.NewTable()
|
||||
raw, err := ioutil.ReadFile(eaclPath)
|
||||
raw, err := os.ReadFile(eaclPath)
|
||||
common.ExitOnErr(cmd, "can't read extended ACL file: %w", err)
|
||||
common.ExitOnErr(cmd, "can't parse extended ACL: %w", json.Unmarshal(raw, table))
|
||||
b.SetEACLTable(*table)
|
||||
|
@ -120,6 +120,6 @@ func createToken(cmd *cobra.Command, _ []string) {
|
|||
}
|
||||
|
||||
out, _ := cmd.Flags().GetString(outFlag)
|
||||
err = ioutil.WriteFile(out, data, 0644)
|
||||
err = os.WriteFile(out, data, 0644)
|
||||
common.ExitOnErr(cmd, "can't write token to file: %w", err)
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ package session
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/google/uuid"
|
||||
internalclient "github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/client"
|
||||
|
@ -77,7 +77,7 @@ func createSession(cmd *cobra.Command, _ []string) {
|
|||
}
|
||||
|
||||
filename, _ := cmd.Flags().GetString(outFlag)
|
||||
err = ioutil.WriteFile(filename, data, 0644)
|
||||
err = os.WriteFile(filename, data, 0644)
|
||||
common.ExitOnErr(cmd, "can't write token to file: %w", err)
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package session
|
|||
|
||||
import (
|
||||
"crypto/ecdsa"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
internalclient "github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/client"
|
||||
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/common"
|
||||
|
@ -28,7 +28,7 @@ func Prepare(cmd *cobra.Command, cnr cid.ID, obj *oid.ID, key *ecdsa.PrivateKey,
|
|||
|
||||
var tok session.Object
|
||||
if tokenPath, _ := cmd.Flags().GetString(commonflags.SessionToken); len(tokenPath) != 0 {
|
||||
data, err := ioutil.ReadFile(tokenPath)
|
||||
data, err := os.ReadFile(tokenPath)
|
||||
common.ExitOnErr(cmd, "can't read session token: %w", err)
|
||||
|
||||
if err := tok.Unmarshal(data); err != nil {
|
||||
|
|
|
@ -3,7 +3,6 @@ package gendoc
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
@ -53,7 +52,7 @@ In this case there is a number of helper functions which can be used:
|
|||
}
|
||||
|
||||
if len(args) == 2 {
|
||||
data, err := ioutil.ReadFile(args[1])
|
||||
data, err := os.ReadFile(args[1])
|
||||
if err != nil {
|
||||
return fmt.Errorf("can't read the template '%s': %w", args[1], err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue