diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index ded674f6..207c5ee7 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -41,7 +41,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.21.x" + go-version: "1.22.x" cache: false - name: Install gitlint run: | @@ -63,7 +63,7 @@ jobs: # 'make lint-go'. uses: golangci/golangci-lint-action@v6.1.0 with: - version: v1.55 + version: v1.56 # Always run this step so that all linting errors can be seen at once. if: always() - name: Ensure a clean code checkout diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 30d425c9..9f5a640a 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.21.x" + go-version: "1.22.x" - name: Cache Go dependencies uses: actions/cache@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index db73c02a..19d8a106 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.21.x" + go-version: "1.22.x" - name: Install GoReleaser uses: goreleaser/goreleaser-action@v5 with: diff --git a/.golangci.yml b/.golangci.yml index 7689e849..d77513ca 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -72,6 +72,7 @@ linters-settings: - github.com/zondax/ledger-go - github.com/foxboron/go-uefi/authenticode - golang.org/x/text + - gopkg.in/yaml.v3 exhaustive: # Switch statements are to be considered exhaustive if a 'default' case is # present, even if all enum members aren't listed in the switch. diff --git a/cmd/account/allow.go b/cmd/account/allow.go index c0ae029a..b8fb3b72 100644 --- a/cmd/account/allow.go +++ b/cmd/account/allow.go @@ -17,7 +17,7 @@ var allowCmd = &cobra.Command{ Use: "allow ", Short: "Configure beneficiary allowance", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() diff --git a/cmd/account/amend_commission_schedule.go b/cmd/account/amend_commission_schedule.go index 4c804f4e..42ee743e 100644 --- a/cmd/account/amend_commission_schedule.go +++ b/cmd/account/amend_commission_schedule.go @@ -23,7 +23,7 @@ var ( amendCommissionScheduleCmd = &cobra.Command{ Use: "amend-commission-schedule", Short: "Amend the validator's commission schedule", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() diff --git a/cmd/account/burn.go b/cmd/account/burn.go index ce23a780..65d3f274 100644 --- a/cmd/account/burn.go +++ b/cmd/account/burn.go @@ -17,7 +17,7 @@ var burnCmd = &cobra.Command{ Use: "burn ", Short: "Burn given amount of tokens", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() diff --git a/cmd/account/delegate.go b/cmd/account/delegate.go index c1a4df1d..a5c06c1d 100644 --- a/cmd/account/delegate.go +++ b/cmd/account/delegate.go @@ -21,7 +21,7 @@ var delegateCmd = &cobra.Command{ Use: "delegate ", Short: "Delegate given amount of tokens to an entity", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() diff --git a/cmd/account/deposit.go b/cmd/account/deposit.go index 900c7c77..3e2230fa 100644 --- a/cmd/account/deposit.go +++ b/cmd/account/deposit.go @@ -22,7 +22,7 @@ var depositCmd = &cobra.Command{ Use: "deposit [to]", Short: "Deposit tokens into ParaTime", Args: cobra.RangeArgs(1, 2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() diff --git a/cmd/account/entity.go b/cmd/account/entity.go index bda13b51..18fef908 100644 --- a/cmd/account/entity.go +++ b/cmd/account/entity.go @@ -30,7 +30,7 @@ var ( entityInitCmd = &cobra.Command{ Use: "init", Short: "Init an empty entity file", - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) @@ -75,7 +75,7 @@ var ( Short: "Register or update account entity in registry", Long: "Register your account and nodes as entity in the network registry or update the existing entry.", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() @@ -135,7 +135,7 @@ var ( Use: "deregister", Short: "Remove account entity from registry", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() @@ -170,7 +170,7 @@ var ( Short: "Update account entity metadata in registry", Long: "Update your account entity metadata in the network registry.", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) diff --git a/cmd/account/from_public_key.go b/cmd/account/from_public_key.go index 2e00acfc..f3a6d99f 100644 --- a/cmd/account/from_public_key.go +++ b/cmd/account/from_public_key.go @@ -13,7 +13,7 @@ var fromPublicKeyCmd = &cobra.Command{ Use: "from-public-key ", Short: "Convert public key to an account address", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { var pk signature.PublicKey err := pk.UnmarshalText([]byte(args[0])) cobra.CheckErr(err) diff --git a/cmd/account/node_unfreeze.go b/cmd/account/node_unfreeze.go index 7e4d744b..ba59312e 100644 --- a/cmd/account/node_unfreeze.go +++ b/cmd/account/node_unfreeze.go @@ -17,7 +17,7 @@ var nodeUnfreezeCmd = &cobra.Command{ Use: "node-unfreeze ", Short: "Unfreeze a frozen validator node", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() diff --git a/cmd/account/show/show.go b/cmd/account/show/show.go index 1234e6a5..e4effb49 100644 --- a/cmd/account/show/show.go +++ b/cmd/account/show/show.go @@ -30,7 +30,7 @@ var ( Short: "Show balance and other information", Aliases: []string{"s"}, Args: cobra.MaximumNArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) diff --git a/cmd/account/transfer.go b/cmd/account/transfer.go index 0fe611d7..6dd679e4 100644 --- a/cmd/account/transfer.go +++ b/cmd/account/transfer.go @@ -22,7 +22,7 @@ var transferCmd = &cobra.Command{ Short: "Transfer given amount of tokens", Aliases: []string{"t"}, Args: cobra.RangeArgs(2, 3), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() diff --git a/cmd/account/undelegate.go b/cmd/account/undelegate.go index 37a49bbf..cdd71b17 100644 --- a/cmd/account/undelegate.go +++ b/cmd/account/undelegate.go @@ -21,7 +21,7 @@ var undelegateCmd = &cobra.Command{ Use: "undelegate ", Short: "Undelegate given amount of shares from an entity", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() diff --git a/cmd/account/withdraw.go b/cmd/account/withdraw.go index ec584aca..9c261e12 100644 --- a/cmd/account/withdraw.go +++ b/cmd/account/withdraw.go @@ -22,7 +22,7 @@ var withdrawCmd = &cobra.Command{ Use: "withdraw [to]", Short: "Withdraw tokens from ParaTime", Args: cobra.RangeArgs(1, 2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() diff --git a/cmd/addressbook.go b/cmd/addressbook.go index 0170b641..9f98bd60 100644 --- a/cmd/addressbook.go +++ b/cmd/addressbook.go @@ -22,7 +22,7 @@ var ( Aliases: []string{"ls"}, Short: "List addresses stored in address book", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := config.Global() table := table.New() table.SetHeader([]string{"Name", "Address"}) @@ -53,7 +53,7 @@ var ( Use: "add
", Short: "Add an address to address book", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := config.Global() name := args[0] address := args[1] @@ -73,7 +73,7 @@ var ( Use: "show ", Short: "Show address information", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { name := args[0] abEntry, ok := config.Global().AddressBook.All[name] if !ok { @@ -93,7 +93,7 @@ var ( Aliases: []string{"rm"}, Short: "Remove an address from address book", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := config.Global() name := args[0] @@ -110,7 +110,7 @@ var ( Aliases: []string{"mv"}, Short: "Rename address", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := config.Global() oldName, newName := args[0], args[1] diff --git a/cmd/contract.go b/cmd/contract.go index 37cf3699..b3b49a49 100644 --- a/cmd/contract.go +++ b/cmd/contract.go @@ -42,7 +42,7 @@ var ( Use: "show ", Short: "Show information about instantiated contract", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) strInstanceID := args[0] @@ -72,7 +72,7 @@ var ( Use: "show-code ", Short: "Show information about uploaded contract code", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) strCodeID := args[0] @@ -110,7 +110,7 @@ var ( Long: `Dump public or confidential contract store in JSON. Valid UTF-8 keys in the result set will be encoded as strings, or otherwise as Base64.`, Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) strInstanceID := args[0] @@ -156,7 +156,7 @@ encoded as strings, or otherwise as Base64.`, a string or Base64-encoded. Valid UTF-8 keys in the result set will be encoded as strings, or otherwise as Base64.`, Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) strInstanceID := args[0] @@ -202,7 +202,7 @@ otherwise as Base64.`, Use: "dump-code ", Short: "Dump WebAssembly smart contract code", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) strCodeID := args[0] @@ -234,7 +234,7 @@ otherwise as Base64.`, Use: "upload [--instantiate-policy POLICY]", Short: "Upload WebAssembly smart contract", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() @@ -288,7 +288,7 @@ otherwise as Base64.`, Aliases: []string{"inst"}, Short: "Instantiate WebAssembly smart contract", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() @@ -347,7 +347,7 @@ otherwise as Base64.`, Use: "call [--tokens TOKENS]", Short: "Call WebAssembly smart contract", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() @@ -412,7 +412,7 @@ otherwise as Base64.`, Use: "change-upgrade-policy ", Short: "Change WebAssembly smart contract upgrade policy", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() diff --git a/cmd/network/add.go b/cmd/network/add.go index 54991ffd..98da6102 100644 --- a/cmd/network/add.go +++ b/cmd/network/add.go @@ -12,7 +12,7 @@ var addCmd = &cobra.Command{ Use: "add ", Short: "Add a new network", Args: cobra.ExactArgs(3), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() name, chainContext, rpc := args[0], args[1], args[2] diff --git a/cmd/network/add_local.go b/cmd/network/add_local.go index 3de6cdd7..8f71e558 100644 --- a/cmd/network/add_local.go +++ b/cmd/network/add_local.go @@ -24,7 +24,7 @@ var ( Use: "add-local ", Short: "Add a new local network", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() name, rpc := args[0], args[1] diff --git a/cmd/network/governance/create.go b/cmd/network/governance/create.go index 65675bad..05c06fbf 100644 --- a/cmd/network/governance/create.go +++ b/cmd/network/governance/create.go @@ -65,7 +65,7 @@ var ( Use: "upgrade ", Short: "Create an upgrade descriptor governance proposal", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() @@ -116,7 +116,7 @@ var ( Use: "parameter-change ", Short: "Create a parameter change governance proposal", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() @@ -171,7 +171,7 @@ var ( Use: "cancel-upgrade ", Short: "Create a cancel upgrade governance proposal", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() diff --git a/cmd/network/governance/list.go b/cmd/network/governance/list.go index 37b76bde..8ad4ef06 100644 --- a/cmd/network/governance/list.go +++ b/cmd/network/governance/list.go @@ -18,7 +18,7 @@ var govListCmd = &cobra.Command{ Aliases: []string{"ls"}, Short: "List governance proposals", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) diff --git a/cmd/network/governance/show.go b/cmd/network/governance/show.go index a578c5d0..1919e80d 100644 --- a/cmd/network/governance/show.go +++ b/cmd/network/governance/show.go @@ -51,7 +51,7 @@ var ( Use: "show ", Short: "Show proposal status by ID", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) diff --git a/cmd/network/governance/vote.go b/cmd/network/governance/vote.go index 1fd7d6ad..b3173678 100644 --- a/cmd/network/governance/vote.go +++ b/cmd/network/governance/vote.go @@ -18,7 +18,7 @@ var govCastVoteCmd = &cobra.Command{ Use: "cast-vote { yes | no | abstain }", Short: "Cast a governance vote on a proposal", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() diff --git a/cmd/network/list.go b/cmd/network/list.go index fd397e28..00a77466 100644 --- a/cmd/network/list.go +++ b/cmd/network/list.go @@ -15,7 +15,7 @@ var listCmd = &cobra.Command{ Aliases: []string{"ls"}, Short: "List configured networks", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() table := table.New() table.SetHeader([]string{"Name", "Chain Context", "RPC"}) diff --git a/cmd/network/remove.go b/cmd/network/remove.go index 6629b255..ee98bdfa 100644 --- a/cmd/network/remove.go +++ b/cmd/network/remove.go @@ -14,7 +14,7 @@ var rmCmd = &cobra.Command{ Aliases: []string{"rm"}, Short: "Remove an existing network", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() name := args[0] diff --git a/cmd/network/set_chain_context.go b/cmd/network/set_chain_context.go index 78582aa7..d4402e96 100644 --- a/cmd/network/set_chain_context.go +++ b/cmd/network/set_chain_context.go @@ -12,7 +12,7 @@ var setChainContextCmd = &cobra.Command{ Use: "set-chain-context ", Short: "Sets the chain context of the given network", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() name, chainContext := args[0], args[1] diff --git a/cmd/network/set_default.go b/cmd/network/set_default.go index e419795a..0f542956 100644 --- a/cmd/network/set_default.go +++ b/cmd/network/set_default.go @@ -10,7 +10,7 @@ var setDefaultCmd = &cobra.Command{ Use: "set-default ", Short: "Sets the given network as the default network", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() name := args[0] diff --git a/cmd/network/set_rpc.go b/cmd/network/set_rpc.go index 258806a1..d71a4371 100644 --- a/cmd/network/set_rpc.go +++ b/cmd/network/set_rpc.go @@ -12,7 +12,7 @@ var setRPCCmd = &cobra.Command{ Use: "set-rpc ", Short: "Sets the RPC endpoint of the given network", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() name, rpc := args[0], args[1] diff --git a/cmd/network/show.go b/cmd/network/show.go index eb8dad15..04c5d4ef 100644 --- a/cmd/network/show.go +++ b/cmd/network/show.go @@ -47,7 +47,7 @@ var showCmd = &cobra.Command{ Long: "Show network property stored in the registry, scheduler, genesis document or chain. Query by ID, hash or a specified kind.", Args: cobra.ExactArgs(1), Aliases: []string{"s"}, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) diff --git a/cmd/network/status.go b/cmd/network/status.go index 7318be13..3d24eea1 100644 --- a/cmd/network/status.go +++ b/cmd/network/status.go @@ -41,7 +41,7 @@ var ( Use: "status", Short: "Show the current status of the node and the network", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) diff --git a/cmd/paratime/add.go b/cmd/paratime/add.go index c96334df..637b8cdf 100644 --- a/cmd/paratime/add.go +++ b/cmd/paratime/add.go @@ -22,7 +22,7 @@ var ( Use: "add ", Short: "Add a new ParaTime", Args: cobra.ExactArgs(3), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() network, name, id := args[0], args[1], args[2] diff --git a/cmd/paratime/denomination/remove.go b/cmd/paratime/denomination/remove.go index e5d8e293..2088f29a 100644 --- a/cmd/paratime/denomination/remove.go +++ b/cmd/paratime/denomination/remove.go @@ -15,7 +15,7 @@ var removeDenomCmd = &cobra.Command{ Use: "remove ", Short: "Remove denomination", Args: cobra.ExactArgs(3), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() networkArg, ptArg, denomArg := args[0], args[1], args[2] diff --git a/cmd/paratime/denomination/set-native.go b/cmd/paratime/denomination/set-native.go index 40ea4887..0df8f335 100644 --- a/cmd/paratime/denomination/set-native.go +++ b/cmd/paratime/denomination/set-native.go @@ -15,7 +15,7 @@ var setNativeDenomCmd = &cobra.Command{ Use: "set-native ", Short: "Set native denomination", Args: cobra.ExactArgs(4), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() networkArg, ptArg, symbolArg, decimalsArg := args[0], args[1], args[2], args[3] diff --git a/cmd/paratime/denomination/set.go b/cmd/paratime/denomination/set.go index 07fa0220..988c2db1 100644 --- a/cmd/paratime/denomination/set.go +++ b/cmd/paratime/denomination/set.go @@ -19,7 +19,7 @@ var ( Use: "set [--symbol ]", Short: "Set denomination", Args: cobra.ExactArgs(4), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() networkArg, ptArg, denomArg, decimalsArg := args[0], args[1], args[2], args[3] diff --git a/cmd/paratime/list.go b/cmd/paratime/list.go index e43a2318..1aa9363b 100644 --- a/cmd/paratime/list.go +++ b/cmd/paratime/list.go @@ -20,7 +20,7 @@ var listCmd = &cobra.Command{ Aliases: []string{"ls"}, Short: "List configured ParaTimes", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() table := table.New() table.SetHeader([]string{"Network", "Paratime", "ID", "Denomination(s)"}) diff --git a/cmd/paratime/register.go b/cmd/paratime/register.go index 85d7f877..63aef4a7 100644 --- a/cmd/paratime/register.go +++ b/cmd/paratime/register.go @@ -18,7 +18,7 @@ var registerCmd = &cobra.Command{ Use: "register ", Short: "Register a new ParaTime or update an existing one", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() diff --git a/cmd/paratime/remove.go b/cmd/paratime/remove.go index 49bb32d6..81f9e9e9 100644 --- a/cmd/paratime/remove.go +++ b/cmd/paratime/remove.go @@ -13,7 +13,7 @@ var removeCmd = &cobra.Command{ Aliases: []string{"rm"}, Short: "Remove an existing ParaTime", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() network, name := args[0], args[1] diff --git a/cmd/paratime/set_default.go b/cmd/paratime/set_default.go index 062c151d..45958bfd 100644 --- a/cmd/paratime/set_default.go +++ b/cmd/paratime/set_default.go @@ -12,7 +12,7 @@ var setDefaultCmd = &cobra.Command{ Use: "set-default ", Short: "Sets the given ParaTime as the default ParaTime for the given network", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() network, name := args[0], args[1] diff --git a/cmd/paratime/show.go b/cmd/paratime/show.go index 5bc07c70..bcecff61 100644 --- a/cmd/paratime/show.go +++ b/cmd/paratime/show.go @@ -33,7 +33,7 @@ var showCmd = &cobra.Command{ Long: "Show information about a given block number and (optionally) its transactions. Use \"latest\" to use the last block.", Aliases: []string{"s"}, Args: cobra.RangeArgs(1, 2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) diff --git a/cmd/paratime/statistics.go b/cmd/paratime/statistics.go index 401f7ce0..82915271 100644 --- a/cmd/paratime/statistics.go +++ b/cmd/paratime/statistics.go @@ -93,7 +93,7 @@ var statsCmd = &cobra.Command{ "\nIf 0 start-height passed, it will generate statistics from the oldest block available to the endpoint.", Aliases: []string{"stats"}, Args: cobra.MaximumNArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) if npa.ParaTime == nil { diff --git a/cmd/rofl/build/sgx.go b/cmd/rofl/build/sgx.go index 9b3c08da..df9eea16 100644 --- a/cmd/rofl/build/sgx.go +++ b/cmd/rofl/build/sgx.go @@ -34,7 +34,7 @@ var ( Use: "sgx", Short: "Build an SGX-based Rust ROFL application", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) diff --git a/cmd/rofl/build/tdx.go b/cmd/rofl/build/tdx.go index 2ce21a2a..bdcb5bc8 100644 --- a/cmd/rofl/build/tdx.go +++ b/cmd/rofl/build/tdx.go @@ -50,7 +50,7 @@ var ( Use: "tdx", Short: "Build a TDX-based ROFL application", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, _ []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) diff --git a/cmd/rofl/identity.go b/cmd/rofl/identity.go index 34f3e6c9..ad9fbbd1 100644 --- a/cmd/rofl/identity.go +++ b/cmd/rofl/identity.go @@ -21,7 +21,7 @@ var ( Short: "Show the cryptographic identity of the ROFL app(s) in the specified bundle", Aliases: []string{"id"}, Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { bundleFn := args[0] bnd, err := bundle.Open(bundleFn) diff --git a/cmd/rofl/mgmt.go b/cmd/rofl/mgmt.go index d43fc9b8..79bbc8b5 100644 --- a/cmd/rofl/mgmt.go +++ b/cmd/rofl/mgmt.go @@ -33,7 +33,7 @@ var ( Use: "create ", Short: "Create a new ROFL application", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() @@ -85,7 +85,7 @@ var ( Use: "update --policy --admin
", Short: "Update an existing ROFL application", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() @@ -146,7 +146,7 @@ var ( Use: "remove ", Short: "Remove an existing ROFL application", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() @@ -189,7 +189,7 @@ var ( Use: "show ", Short: "Show information about a ROFL application", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) rawAppID := args[0] diff --git a/cmd/rofl/trust_root.go b/cmd/rofl/trust_root.go index 47de9b58..da7dfdd1 100644 --- a/cmd/rofl/trust_root.go +++ b/cmd/rofl/trust_root.go @@ -16,7 +16,7 @@ var trustRootCmd = &cobra.Command{ Use: "trust-root", Short: "Show a recent trust root for a ROFL application", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) diff --git a/cmd/tx.go b/cmd/tx.go index 9ffb334b..2a52cb55 100644 --- a/cmd/tx.go +++ b/cmd/tx.go @@ -30,7 +30,7 @@ var ( Use: "submit ", Short: "Submit a transaction", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) filename := args[0] @@ -72,7 +72,7 @@ var ( Use: "sign ", Short: "Sign an unsigned transaction", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) txCfg := common.GetTransactionConfig() @@ -119,7 +119,7 @@ var ( Use: "show ", Short: "Pretty print a transaction", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := cliConfig.Global() npa := common.GetNPASelection(cfg) filename := args[0] diff --git a/cmd/wallet/create.go b/cmd/wallet/create.go index 5fdfcf1a..b2cb74eb 100644 --- a/cmd/wallet/create.go +++ b/cmd/wallet/create.go @@ -18,7 +18,7 @@ var createCmd = &cobra.Command{ Use: "create ", Short: "Create a new account", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := config.Global() name := args[0] diff --git a/cmd/wallet/export.go b/cmd/wallet/export.go index 0494ff39..54df2aab 100644 --- a/cmd/wallet/export.go +++ b/cmd/wallet/export.go @@ -13,7 +13,7 @@ var exportCmd = &cobra.Command{ Use: "export ", Short: "Export secret account information", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { name := args[0] fmt.Printf("WARNING: Exporting the account will expose secret key material!\n") diff --git a/cmd/wallet/import.go b/cmd/wallet/import.go index abd86f84..7662056e 100644 --- a/cmd/wallet/import.go +++ b/cmd/wallet/import.go @@ -27,7 +27,7 @@ var ( Use: "import ", Short: "Import an existing account", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := config.Global() name := args[0] diff --git a/cmd/wallet/import_file.go b/cmd/wallet/import_file.go index 453c987c..042c4b0f 100644 --- a/cmd/wallet/import_file.go +++ b/cmd/wallet/import_file.go @@ -20,7 +20,7 @@ var importFileCmd = &cobra.Command{ Short: "Import an existing account from file", Long: "Import the private key from an existing PEM file", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := config.Global() name := args[0] filename := args[1] diff --git a/cmd/wallet/list.go b/cmd/wallet/list.go index 49b470c0..1a8b1b73 100644 --- a/cmd/wallet/list.go +++ b/cmd/wallet/list.go @@ -15,7 +15,7 @@ var listCmd = &cobra.Command{ Aliases: []string{"ls"}, Short: "List configured accounts", Args: cobra.NoArgs, - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := config.Global() table := table.New() table.SetHeader([]string{"Account", "Kind", "Address"}) diff --git a/cmd/wallet/remote_signer.go b/cmd/wallet/remote_signer.go index b020e454..5405fcd6 100644 --- a/cmd/wallet/remote_signer.go +++ b/cmd/wallet/remote_signer.go @@ -20,7 +20,7 @@ var remoteSignerCmd = &cobra.Command{ Use: "remote-signer ", Short: "Act as a oasis-node remote entity signer over AF_LOCAL", Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { name, socketPath := args[0], args[1] acc := common.LoadAccount(config.Global(), name) diff --git a/cmd/wallet/remove.go b/cmd/wallet/remove.go index 056d2afa..2d34275f 100644 --- a/cmd/wallet/remove.go +++ b/cmd/wallet/remove.go @@ -16,7 +16,7 @@ var rmCmd = &cobra.Command{ Aliases: []string{"rm"}, Short: "Remove existing account(s)", Args: cobra.MinimumNArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := config.Global() // Remove duplicated arguments diff --git a/cmd/wallet/rename.go b/cmd/wallet/rename.go index f8da4655..b7201c3b 100644 --- a/cmd/wallet/rename.go +++ b/cmd/wallet/rename.go @@ -13,7 +13,7 @@ var renameCmd = &cobra.Command{ Short: "Rename an existing account", Aliases: []string{"mv"}, Args: cobra.ExactArgs(2), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := config.Global() oldName, newName := args[0], args[1] diff --git a/cmd/wallet/set_default.go b/cmd/wallet/set_default.go index 5121bc05..10218168 100644 --- a/cmd/wallet/set_default.go +++ b/cmd/wallet/set_default.go @@ -10,7 +10,7 @@ var setDefaultCmd = &cobra.Command{ Use: "set-default ", Short: "Sets the given account as the default account", Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { cfg := config.Global() name := args[0] diff --git a/cmd/wallet/show.go b/cmd/wallet/show.go index 780d7fc4..14dab7b0 100644 --- a/cmd/wallet/show.go +++ b/cmd/wallet/show.go @@ -15,7 +15,7 @@ var showCmd = &cobra.Command{ Short: "Show public account information", Aliases: []string{"s"}, Args: cobra.ExactArgs(1), - Run: func(cmd *cobra.Command, args []string) { + Run: func(_ *cobra.Command, args []string) { name := args[0] acc := common.LoadAccount(config.Global(), name) diff --git a/wallet/wallet.go b/wallet/wallet.go index 58b8d412..205e2993 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -173,7 +173,7 @@ func Load(kind string) (Factory, error) { // AvailableKinds returns all of the available account factories. func AvailableKinds() []Factory { var kinds []Factory - registeredFactories.Range(func(key, value interface{}) bool { + registeredFactories.Range(func(_, value interface{}) bool { kinds = append(kinds, value.(Factory)) return true })