Skip to content

Commit

Permalink
ci: Bump Go to 1.22.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko committed Nov 15, 2024
1 parent 64c9753 commit 3e4ca2c
Show file tree
Hide file tree
Showing 58 changed files with 81 additions and 80 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -63,7 +63,7 @@ jobs:
# 'make lint-go'.
uses: golangci/[email protected]
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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/account/allow.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var allowCmd = &cobra.Command{
Use: "allow <beneficiary> <amount>",
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()
Expand Down
2 changes: 1 addition & 1 deletion cmd/account/amend_commission_schedule.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, _ []string) {
cfg := cliConfig.Global()
npa := common.GetNPASelection(cfg)
txCfg := common.GetTransactionConfig()
Expand Down
2 changes: 1 addition & 1 deletion cmd/account/burn.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var burnCmd = &cobra.Command{
Use: "burn <amount>",
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()
Expand Down
2 changes: 1 addition & 1 deletion cmd/account/delegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var delegateCmd = &cobra.Command{
Use: "delegate <amount> <to>",
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()
Expand Down
2 changes: 1 addition & 1 deletion cmd/account/deposit.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var depositCmd = &cobra.Command{
Use: "deposit <amount> [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()
Expand Down
8 changes: 4 additions & 4 deletions cmd/account/entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Check failure on line 33 in cmd/account/entity.go

View workflow job for this annotation

GitHub Actions / lint

unused-parameter: parameter 'args' seems to be unused, consider removing or renaming it as _ (revive)
cfg := cliConfig.Global()
npa := common.GetNPASelection(cfg)

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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) {

Check failure on line 138 in cmd/account/entity.go

View workflow job for this annotation

GitHub Actions / lint

unused-parameter: parameter 'args' seems to be unused, consider removing or renaming it as _ (revive)
cfg := cliConfig.Global()
npa := common.GetNPASelection(cfg)
txCfg := common.GetTransactionConfig()
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion cmd/account/from_public_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var fromPublicKeyCmd = &cobra.Command{
Use: "from-public-key <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)
Expand Down
2 changes: 1 addition & 1 deletion cmd/account/node_unfreeze.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var nodeUnfreezeCmd = &cobra.Command{
Use: "node-unfreeze <node-id>",
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()
Expand Down
2 changes: 1 addition & 1 deletion cmd/account/show/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion cmd/account/transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion cmd/account/undelegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var undelegateCmd = &cobra.Command{
Use: "undelegate <shares> <from>",
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()
Expand Down
2 changes: 1 addition & 1 deletion cmd/account/withdraw.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var withdrawCmd = &cobra.Command{
Use: "withdraw <amount> [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()
Expand Down
10 changes: 5 additions & 5 deletions cmd/addressbook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down Expand Up @@ -53,7 +53,7 @@ var (
Use: "add <name> <address>",
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]
Expand All @@ -73,7 +73,7 @@ var (
Use: "show <name>",
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 {
Expand All @@ -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]

Expand All @@ -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]

Expand Down
18 changes: 9 additions & 9 deletions cmd/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var (
Use: "show <instance-id>",
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]
Expand Down Expand Up @@ -72,7 +72,7 @@ var (
Use: "show-code <code-id>",
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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -202,7 +202,7 @@ otherwise as Base64.`,
Use: "dump-code <code-id>",
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]
Expand Down Expand Up @@ -234,7 +234,7 @@ otherwise as Base64.`,
Use: "upload <contract.wasm> [--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()
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -347,7 +347,7 @@ otherwise as Base64.`,
Use: "call <instance-id> <data-yaml> [--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()
Expand Down Expand Up @@ -412,7 +412,7 @@ otherwise as Base64.`,
Use: "change-upgrade-policy <instance-id> <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()
Expand Down
2 changes: 1 addition & 1 deletion cmd/network/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var addCmd = &cobra.Command{
Use: "add <name> <chain-context> <rpc-endpoint>",
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]

Expand Down
2 changes: 1 addition & 1 deletion cmd/network/add_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var (
Use: "add-local <name> <rpc-endpoint>",
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]

Expand Down
6 changes: 3 additions & 3 deletions cmd/network/governance/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var (
Use: "upgrade <descriptor.json>",
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()
Expand Down Expand Up @@ -116,7 +116,7 @@ var (
Use: "parameter-change <module> <changes.json>",
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()
Expand Down Expand Up @@ -171,7 +171,7 @@ var (
Use: "cancel-upgrade <proposal-id>",
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()
Expand Down
2 changes: 1 addition & 1 deletion cmd/network/governance/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, _ []string) {
cfg := cliConfig.Global()
npa := common.GetNPASelection(cfg)

Expand Down
2 changes: 1 addition & 1 deletion cmd/network/governance/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ var (
Use: "show <proposal-id>",
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)

Expand Down
2 changes: 1 addition & 1 deletion cmd/network/governance/vote.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var govCastVoteCmd = &cobra.Command{
Use: "cast-vote <proposal-id> { 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()
Expand Down
2 changes: 1 addition & 1 deletion cmd/network/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
Expand Down
2 changes: 1 addition & 1 deletion cmd/network/remove.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
Loading

0 comments on commit 3e4ca2c

Please sign in to comment.