forked from TrueCloudLab/frostfs-node
[#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 (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
@ -56,7 +55,7 @@ func TestInitialize(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
protoPath := filepath.Join(walletDir, "proto.yml")
|
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)
|
v.Set(protoConfigPath, protoPath)
|
||||||
// Set to the path or remove the next statement to download from the network.
|
// Set to the path or remove the next statement to download from the network.
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
internalclient "github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/client"
|
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)
|
eaclPath, _ := cmd.Flags().GetString(eaclFlag)
|
||||||
if eaclPath != "" {
|
if eaclPath != "" {
|
||||||
table := eaclSDK.NewTable()
|
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 read extended ACL file: %w", err)
|
||||||
common.ExitOnErr(cmd, "can't parse extended ACL: %w", json.Unmarshal(raw, table))
|
common.ExitOnErr(cmd, "can't parse extended ACL: %w", json.Unmarshal(raw, table))
|
||||||
b.SetEACLTable(*table)
|
b.SetEACLTable(*table)
|
||||||
|
@ -120,6 +120,6 @@ func createToken(cmd *cobra.Command, _ []string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
out, _ := cmd.Flags().GetString(outFlag)
|
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)
|
common.ExitOnErr(cmd, "can't write token to file: %w", err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ package session
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"os"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
internalclient "github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/client"
|
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)
|
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)
|
common.ExitOnErr(cmd, "can't write token to file: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package session
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/ecdsa"
|
"crypto/ecdsa"
|
||||||
"io/ioutil"
|
"os"
|
||||||
|
|
||||||
internalclient "github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/client"
|
internalclient "github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/client"
|
||||||
"github.com/nspcc-dev/neofs-node/cmd/neofs-cli/internal/common"
|
"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
|
var tok session.Object
|
||||||
if tokenPath, _ := cmd.Flags().GetString(commonflags.SessionToken); len(tokenPath) != 0 {
|
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)
|
common.ExitOnErr(cmd, "can't read session token: %w", err)
|
||||||
|
|
||||||
if err := tok.Unmarshal(data); err != nil {
|
if err := tok.Unmarshal(data); err != nil {
|
||||||
|
|
|
@ -3,7 +3,6 @@ package gendoc
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -53,7 +52,7 @@ In this case there is a number of helper functions which can be used:
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(args) == 2 {
|
if len(args) == 2 {
|
||||||
data, err := ioutil.ReadFile(args[1])
|
data, err := os.ReadFile(args[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("can't read the template '%s': %w", args[1], err)
|
return fmt.Errorf("can't read the template '%s': %w", args[1], err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue