[#973] node: Resolve revive: unused-parameter linter

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2024-03-11 17:11:49 +03:00
parent dacf580b87
commit 66a26b7775
34 changed files with 41 additions and 41 deletions

View file

@ -23,7 +23,7 @@ var accountingBalanceCmd = &cobra.Command{
Use: "balance",
Short: "Get internal balance of FrostFS account",
Long: `Get internal balance of FrostFS account`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
var idUser user.ID
pk := key.GetOrGenerate(cmd)

View file

@ -11,7 +11,7 @@ var Cmd = &cobra.Command{
Use: "accounting",
Short: "Operations with accounts and balances",
Long: `Operations with accounts and balances`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
PersistentPreRun: func(cmd *cobra.Command, _ []string) {
flags := cmd.Flags()
_ = viper.BindPFlag(commonflags.WalletPath, flags.Lookup(commonflags.WalletPath))

View file

@ -38,7 +38,7 @@ var createContainerCmd = &cobra.Command{
Short: "Create new container",
Long: `Create new container and register it in the FrostFS.
It will be stored in sidechain when inner ring will accepts it.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
placementPolicy, err := parseContainerPolicy(cmd, containerPolicy)
commonCmd.ExitOnErr(cmd, "", err)

View file

@ -20,7 +20,7 @@ var deleteContainerCmd = &cobra.Command{
Short: "Delete existing container",
Long: `Delete existing container.
Only owner of the container has a permission to remove container.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
id := parseContainerID(cmd)
tok := getSession(cmd)

View file

@ -33,7 +33,7 @@ var getContainerInfoCmd = &cobra.Command{
Use: "get",
Short: "Get container field info",
Long: `Get container field info`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
cnr, _ := getContainer(cmd)
prettyPrintContainer(cmd, cnr, containerJSON)

View file

@ -16,7 +16,7 @@ var getExtendedACLCmd = &cobra.Command{
Use: "get-eacl",
Short: "Get extended ACL table of container",
Long: `Get extended ACL table of container`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
id := parseContainerID(cmd)
pk := key.GetOrGenerate(cmd)
cli := internalclient.GetSDKClientByFlag(cmd, pk, commonflags.RPC)

View file

@ -31,7 +31,7 @@ var listContainersCmd = &cobra.Command{
Use: "list",
Short: "List all created containers",
Long: "List all created containers",
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
var idUser user.ID
key := key.GetOrGenerate(cmd)

View file

@ -28,7 +28,7 @@ var listContainerObjectsCmd = &cobra.Command{
Use: "list-objects",
Short: "List existing objects in container",
Long: `List existing objects in container`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
id := parseContainerID(cmd)
filters := new(objectSDK.SearchFilters)

View file

@ -19,7 +19,7 @@ var containerNodesCmd = &cobra.Command{
Use: "nodes",
Short: "Show nodes for container",
Long: "Show nodes taking part in a container at the current epoch.",
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
cnr, pkey := getContainer(cmd)
if pkey == nil {

View file

@ -10,7 +10,7 @@ var Cmd = &cobra.Command{
Use: "container",
Short: "Operations with containers",
Long: "Operations with containers",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
PersistentPreRun: func(cmd *cobra.Command, _ []string) {
// bind exactly that cmd's flags to
// the viper before execution
commonflags.Bind(cmd)

View file

@ -25,7 +25,7 @@ var setExtendedACLCmd = &cobra.Command{
Short: "Set new extended ACL table for container",
Long: `Set new extended ACL table for container.
Container ID in EACL table will be substituted with ID from the CLI.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
id := parseContainerID(cmd)
eaclTable := common.ReadEACL(cmd, flagVarsSetEACL.srcPath)

View file

@ -14,7 +14,7 @@ var dropObjectsCmd = &cobra.Command{
Use: "drop-objects",
Short: "Drop objects from the node's local storage",
Long: "Drop objects from the node's local storage",
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
pk := key.Get(cmd)
dropObjectsList, _ := cmd.Flags().GetStringSlice(dropObjectsFlag)

View file

@ -10,7 +10,7 @@ var Cmd = &cobra.Command{
Use: "control",
Short: "Operations with storage node",
Long: `Operations with storage node`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
PersistentPreRun: func(cmd *cobra.Command, _ []string) {
ff := cmd.Flags()
_ = viper.BindPFlag(commonflags.WalletPath, ff.Lookup(commonflags.WalletPath))

View file

@ -12,7 +12,7 @@ var getEpochCmd = &cobra.Command{
Use: "epoch",
Short: "Get current epoch number",
Long: "Get current epoch number",
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
p := key.GetOrGenerate(cmd)
cli := internalclient.GetSDKClientByFlag(cmd, p, commonflags.RPC)

View file

@ -16,7 +16,7 @@ var netInfoCmd = &cobra.Command{
Use: "netinfo",
Short: "Get information about FrostFS network",
Long: "Get information about FrostFS network",
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
p := key.GetOrGenerate(cmd)
cli := internalclient.GetSDKClientByFlag(cmd, p, commonflags.RPC)

View file

@ -18,7 +18,7 @@ var nodeInfoCmd = &cobra.Command{
Use: "nodeinfo",
Short: "Get target node info",
Long: `Get target node info`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
p := key.GetOrGenerate(cmd)
cli := internalclient.GetSDKClientByFlag(cmd, p, commonflags.RPC)

View file

@ -9,7 +9,7 @@ var Cmd = &cobra.Command{
Use: "netmap",
Short: "Operations with Network Map",
Long: `Operations with Network Map`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
PersistentPreRun: func(cmd *cobra.Command, _ []string) {
// bind exactly that cmd's flags to
// the viper before execution
commonflags.Bind(cmd)

View file

@ -12,7 +12,7 @@ var snapshotCmd = &cobra.Command{
Use: "snapshot",
Short: "Request current local snapshot of the network map",
Long: `Request current local snapshot of the network map`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
p := key.GetOrGenerate(cmd)
cli := internalclient.GetSDKClientByFlag(cmd, p, commonflags.RPC)

View file

@ -174,7 +174,7 @@ func setFilePayloadReader(cmd *cobra.Command, f *os.File, prm *internalclient.Pu
p := pb.New64(fi.Size())
p.Output = cmd.OutOrStdout()
prm.SetPayloadReader(p.NewProxyReader(f))
prm.SetHeaderCallback(func(o *objectSDK.Object) { p.Start() })
prm.SetHeaderCallback(func() { p.Start() })
return p
}
@ -182,7 +182,7 @@ func setBinaryPayloadReader(cmd *cobra.Command, obj *objectSDK.Object, prm *inte
p := pb.New(len(obj.Payload()))
p.Output = cmd.OutOrStdout()
prm.SetPayloadReader(p.NewProxyReader(payloadReader))
prm.SetHeaderCallback(func(o *objectSDK.Object) { p.Start() })
prm.SetHeaderCallback(func() { p.Start() })
return p
}

View file

@ -10,7 +10,7 @@ var Cmd = &cobra.Command{
Use: "object",
Short: "Operations with Objects",
Long: `Operations with Objects`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
PersistentPreRun: func(cmd *cobra.Command, _ []string) {
// bind exactly that cmd's flags to
// the viper before execution
commonflags.Bind(cmd)

View file

@ -29,7 +29,7 @@ var createCmd = &cobra.Command{
Use: "create",
Short: "Create session token",
Run: createSession,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
PersistentPreRun: func(cmd *cobra.Command, _ []string) {
_ = viper.BindPFlag(commonflags.WalletPath, cmd.Flags().Lookup(commonflags.WalletPath))
_ = viper.BindPFlag(commonflags.Account, cmd.Flags().Lookup(commonflags.Account))
},

View file

@ -9,7 +9,7 @@ import (
var Cmd = &cobra.Command{
Use: "util",
Short: "Utility operations",
PersistentPreRun: func(cmd *cobra.Command, args []string) {
PersistentPreRun: func(cmd *cobra.Command, _ []string) {
flags := cmd.Flags()
_ = viper.BindPFlag(commonflags.GenerateKey, flags.Lookup(commonflags.GenerateKey))