diff --git a/cmd/neofs-cli/internal/common/token.go b/cmd/neofs-cli/internal/common/token.go index 5bb5fc955c..92e08b8674 100644 --- a/cmd/neofs-cli/internal/common/token.go +++ b/cmd/neofs-cli/internal/common/token.go @@ -27,7 +27,7 @@ func ReadBearerToken(cmd *cobra.Command, flagname string) (*bearer.Token, error) err = ReadBinaryOrJSON(cmd, &tok, path) if err != nil { - return nil, fmt.Errorf("invalid bearer token: %v", err) + return nil, fmt.Errorf("invalid bearer token: %w", err) } return &tok, nil diff --git a/cmd/neofs-cli/modules/acl/extended/create.go b/cmd/neofs-cli/modules/acl/extended/create.go index d2cd5f2a30..ef31776464 100644 --- a/cmd/neofs-cli/modules/acl/extended/create.go +++ b/cmd/neofs-cli/modules/acl/extended/create.go @@ -72,13 +72,13 @@ func createEACL(cmd *cobra.Command, _ []string) error { var containerID cid.ID if cidArg != "" { if err := containerID.DecodeString(cidArg); err != nil { - return fmt.Errorf("invalid container ID: %v\n", err) + return fmt.Errorf("invalid container ID: %w\n", err) } } rulesFile, err := getRulesFromFile(fileArg) if err != nil { - return fmt.Errorf("can't read rules from file: %v\n", err) + return fmt.Errorf("can't read rules from file: %w\n", err) } rules = append(rules, rulesFile...) diff --git a/cmd/neofs-cli/modules/container/create.go b/cmd/neofs-cli/modules/container/create.go index 9912f4ffb0..0079985e7a 100644 --- a/cmd/neofs-cli/modules/container/create.go +++ b/cmd/neofs-cli/modules/container/create.go @@ -152,7 +152,7 @@ It will be stored in sidechain when inner ring will accepts it.`, for ; ; t.Reset(waitInterval) { select { case <-ctx.Done(): - return fmt.Errorf("container creation: %s", common.ErrAwaitTimeout) + return fmt.Errorf("container creation: %w", common.ErrAwaitTimeout) case <-t.C: } diff --git a/cmd/neofs-cli/modules/container/delete.go b/cmd/neofs-cli/modules/container/delete.go index b3c3a15ef4..83e7114a4b 100644 --- a/cmd/neofs-cli/modules/container/delete.go +++ b/cmd/neofs-cli/modules/container/delete.go @@ -132,7 +132,7 @@ Only owner of the container has a permission to remove container.`, for ; ; t.Reset(waitInterval) { select { case <-ctx.Done(): - return fmt.Errorf("container deletion: %s", common.ErrAwaitTimeout) + return fmt.Errorf("container deletion: %w", common.ErrAwaitTimeout) case <-t.C: } diff --git a/cmd/neofs-cli/modules/container/set_eacl.go b/cmd/neofs-cli/modules/container/set_eacl.go index d28c24b965..b9687196ca 100644 --- a/cmd/neofs-cli/modules/container/set_eacl.go +++ b/cmd/neofs-cli/modules/container/set_eacl.go @@ -136,7 +136,7 @@ Container ID in EACL table will be substituted with ID from the CLI.`, for ; ; t.Reset(waitInterval) { select { case <-ctx.Done(): - return fmt.Errorf("eACL setting: %s", common.ErrAwaitTimeout) + return fmt.Errorf("eACL setting: %w", common.ErrAwaitTimeout) case <-t.C: } diff --git a/cmd/neofs-cli/modules/container/util.go b/cmd/neofs-cli/modules/container/util.go index c984d5cd60..0df0e76b96 100644 --- a/cmd/neofs-cli/modules/container/util.go +++ b/cmd/neofs-cli/modules/container/util.go @@ -49,7 +49,7 @@ func getSession(cmd *cobra.Command) (*session.Container, error) { err := common.ReadBinaryOrJSON(cmd, &res, path) if err != nil { - return nil, fmt.Errorf("read container session: %v", err) + return nil, fmt.Errorf("read container session: %w", err) } common.PrintVerbose(cmd, "Session successfully read.") diff --git a/cmd/neofs-cli/modules/object/lock.go b/cmd/neofs-cli/modules/object/lock.go index f91aebf535..2fa3e693b4 100644 --- a/cmd/neofs-cli/modules/object/lock.go +++ b/cmd/neofs-cli/modules/object/lock.go @@ -32,7 +32,7 @@ var objectLockCmd = &cobra.Command{ var cnr cid.ID err := cnr.DecodeString(cidRaw) if err != nil { - return fmt.Errorf("Incorrect container arg: %v", err) + return fmt.Errorf("Incorrect container arg: %w", err) } oidsRaw, _ := cmd.Flags().GetStringSlice(commonflags.OIDFlag) diff --git a/cmd/neofs-cli/modules/object/util.go b/cmd/neofs-cli/modules/object/util.go index 94e1138fbd..a765a2288f 100644 --- a/cmd/neofs-cli/modules/object/util.go +++ b/cmd/neofs-cli/modules/object/util.go @@ -162,7 +162,7 @@ func getSession(cmd *cobra.Command) (*session.Object, error) { err := common.ReadBinaryOrJSON(cmd, &tok, path) if err != nil { - return nil, fmt.Errorf("read session: %v", err) + return nil, fmt.Errorf("read session: %w", err) } return &tok, nil diff --git a/cmd/neofs-cli/modules/util/sign_session.go b/cmd/neofs-cli/modules/util/sign_session.go index 92341b7125..33b1da5f61 100644 --- a/cmd/neofs-cli/modules/util/sign_session.go +++ b/cmd/neofs-cli/modules/util/sign_session.go @@ -63,7 +63,7 @@ func signSessionToken(cmd *cobra.Command, _ []string) error { } if errLast != nil { - return fmt.Errorf("decode session: %v", errLast) + return fmt.Errorf("decode session: %w", errLast) } pk, err := key.GetOrGenerate(cmd) diff --git a/pkg/innerring/processors/neofs/process_assets.go b/pkg/innerring/processors/neofs/process_assets.go index 164988a9ab..4e324ea763 100644 --- a/pkg/innerring/processors/neofs/process_assets.go +++ b/pkg/innerring/processors/neofs/process_assets.go @@ -53,15 +53,15 @@ func (np *Processor) processDeposit(deposit *neofsEvent.Deposit) { // get gas balance of the node // before gas transfer check if the balance is greater than the threshold - balance, err := np.morphClient.GasBalance() + gasBalance, err := np.morphClient.GasBalance() if err != nil { np.log.Error("can't get gas balance of the node", zap.Error(err)) return } - if balance < np.gasBalanceThreshold { + if gasBalance < np.gasBalanceThreshold { np.log.Warn("gas balance threshold has been reached", - zap.Int64("balance", balance), + zap.Int64("balance", gasBalance), zap.Int64("threshold", np.gasBalanceThreshold)) return diff --git a/pkg/local_object_storage/engine/lock_test.go b/pkg/local_object_storage/engine/lock_test.go index 73e96d7654..baeb1039cb 100644 --- a/pkg/local_object_storage/engine/lock_test.go +++ b/pkg/local_object_storage/engine/lock_test.go @@ -1,7 +1,6 @@ package engine import ( - "context" "os" "strconv" "testing" @@ -20,14 +19,6 @@ import ( "github.com/stretchr/testify/require" ) -type tss struct { - expEpoch uint64 -} - -func (t tss) IsTombstoneAvailable(ctx context.Context, _ oid.Address, epoch uint64) bool { - return t.expEpoch >= epoch -} - func TestLockUserScenario(t *testing.T) { // Tested user actions: // 1. stores some object diff --git a/pkg/services/object/get/remote.go b/pkg/services/object/get/remote.go index 2cadb23976..566ec6f25e 100644 --- a/pkg/services/object/get/remote.go +++ b/pkg/services/object/get/remote.go @@ -17,12 +17,12 @@ func (exec *execCtx) processNode(info client.NodeInfo) bool { l.Debug("processing node...") - client, ok := exec.remoteClient(info) + remoteClient, ok := exec.remoteClient(info) if !ok { return true } - obj, err := client.getObject(exec, info) + obj, err := remoteClient.getObject(exec, info) var errSplitInfo *objectSDK.SplitInfoError