Skip to content

Commit fecb52b

Browse files
authored
Merge pull request #655 from oasisprotocol/ptrus/feature/go-1.25
Update Go to 1.25.4 and golangci-lint to v2
2 parents aec1603 + 4211f91 commit fecb52b

File tree

7 files changed

+97
-76
lines changed

7 files changed

+97
-76
lines changed

.github/workflows/ci-lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Set up Go
4242
uses: actions/setup-go@v5
4343
with:
44-
go-version: "1.24.x"
44+
go-version: "1.25.x"
4545
cache: false
4646
- name: Install gitlint
4747
run: |
@@ -61,9 +61,9 @@ jobs:
6161
# NOTE: Using the official golangci-lint GitHub Action should give
6262
# better performance than manually installing golangci-lint and running
6363
# 'make lint-go'.
64-
uses: golangci/golangci-lint-action@v6.5.0
64+
uses: golangci/golangci-lint-action@v9
6565
with:
66-
version: v1.64
66+
version: v2.6.2
6767
# Always run this step so that all linting errors can be seen at once.
6868
if: always()
6969
- name: Ensure a clean code checkout

.github/workflows/ci-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Set up Go
3030
uses: actions/setup-go@v5
3131
with:
32-
go-version: "1.24.x"
32+
go-version: "1.25.x"
3333
- name: Cache Go dependencies
3434
uses: actions/cache@v4
3535
with:
@@ -48,4 +48,4 @@ jobs:
4848
run: |
4949
make clean-examples
5050
make examples
51-
git diff --exit-code examples
51+
git diff --exit-code examples

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
goreleaser:
1313
runs-on: ubuntu-latest
1414
container:
15-
image: ghcr.io/goreleaser/goreleaser-cross:v1.22.3
15+
image: ghcr.io/goreleaser/goreleaser-cross:v1.25
1616
options: --user 1001
1717
steps:
1818
- name: Checkout
@@ -22,7 +22,7 @@ jobs:
2222
- name: Set up Go
2323
uses: actions/setup-go@v5
2424
with:
25-
go-version: "1.24.x"
25+
go-version: "1.25.x"
2626
- name: Install GoReleaser
2727
uses: goreleaser/goreleaser-action@v5
2828
with:

.golangci.yml

Lines changed: 77 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,107 @@
1-
# golangci-lint configuration.
2-
3-
# For more information, see:
4-
# https://golangci-lint.run/usage/configuration/.
5-
6-
run:
7-
timeout: 5m
8-
1+
version: "2"
92
linters:
10-
# Disable all linters except the ones explicitly listed below.
11-
disable-all: true
3+
default: none
124
enable:
135
- asciicheck
146
- bodyclose
157
- depguard
168
- dogsled
179
- dupl
1810
- errcheck
19-
- exhaustive
2011
- goconst
2112
- gocritic
2213
- gocyclo
2314
- godot
24-
- gofumpt
2515
- goheader
26-
- goimports
27-
- revive
2816
- gomodguard
2917
- goprintffuncname
3018
- gosec
31-
- gosimple
3219
- govet
3320
- ineffassign
3421
- misspell
3522
- nakedret
3623
- nestif
37-
- noctx
3824
- nolintlint
3925
- prealloc
26+
- revive
4027
- rowserrcheck
41-
- staticcheck
42-
- stylecheck
4328
- sqlclosecheck
44-
- typecheck
29+
- staticcheck
4530
- unconvert
4631
- unparam
4732
- unused
4833
- whitespace
49-
50-
linters-settings:
51-
depguard:
34+
settings:
35+
depguard:
36+
rules:
37+
main:
38+
files:
39+
- $all
40+
allow:
41+
- $gostd
42+
- golang.org/x/sys/unix
43+
- golang.org/x/crypto/sha3
44+
- golang.org/x/crypto/argon2
45+
- github.com/oasisprotocol
46+
- github.com/btcsuite/btcd
47+
- github.com/adrg/xdg
48+
- github.com/AlecAivazis/survey/v2
49+
- github.com/ethereum/go-ethereum
50+
- github.com/miguelmota/go-ethereum-hdwallet
51+
- github.com/mitchellh/mapstructure
52+
- github.com/olekukonko/tablewriter
53+
- github.com/spf13/cobra
54+
- github.com/spf13/pflag
55+
- github.com/spf13/viper
56+
- github.com/stretchr/testify
57+
- github.com/tyler-smith/go-bip39
58+
- github.com/zondax/ledger-go
59+
- github.com/foxboron/go-uefi/authenticode
60+
- golang.org/x/text
61+
- gopkg.in/yaml.v3
62+
- github.com/compose-spec/compose-go/v2
63+
- github.com/github/go-spdx/v2
64+
- github.com/opencontainers/image-spec/specs-go/v1
65+
- oras.land/oras-go/v2
66+
- github.com/wI2L/jsondiff
67+
- github.com/google/uuid
68+
- golang.org/x/net/idna
69+
- golang.org/x/term
70+
deny:
71+
- pkg: github.com/pkg/errors
72+
desc: Should be replaced by standard lib errors package
73+
- pkg: github.com/fxamacker/cbor/v2
74+
desc: Use oasis-core/go/common/cbor instead
75+
exclusions:
76+
generated: lax
77+
presets:
78+
- comments
79+
- common-false-positives
80+
- legacy
81+
- std-error-handling
5282
rules:
53-
main:
54-
files:
55-
- $all
56-
allow:
57-
- $gostd
58-
- golang.org/x/sys/unix
59-
- golang.org/x/crypto/sha3
60-
- golang.org/x/crypto/argon2
61-
- github.com/oasisprotocol
62-
- github.com/btcsuite/btcd
63-
- github.com/adrg/xdg
64-
- github.com/AlecAivazis/survey/v2
65-
- github.com/ethereum/go-ethereum
66-
- github.com/miguelmota/go-ethereum-hdwallet
67-
- github.com/mitchellh/mapstructure
68-
- github.com/olekukonko/tablewriter
69-
- github.com/spf13/cobra
70-
- github.com/spf13/pflag
71-
- github.com/spf13/viper
72-
- github.com/stretchr/testify
73-
- github.com/tyler-smith/go-bip39
74-
- github.com/zondax/ledger-go
75-
- github.com/foxboron/go-uefi/authenticode
76-
- golang.org/x/text
77-
- gopkg.in/yaml.v3
78-
- github.com/compose-spec/compose-go/v2
79-
- github.com/github/go-spdx/v2
80-
- github.com/opencontainers/image-spec/specs-go/v1
81-
- oras.land/oras-go/v2
82-
- github.com/wI2L/jsondiff
83-
- github.com/google/uuid
84-
- golang.org/x/net/idna
85-
- golang.org/x/term
86-
exhaustive:
87-
# Switch statements are to be considered exhaustive if a 'default' case is
88-
# present, even if all enum members aren't listed in the switch.
89-
default-signifies-exhaustive: true
83+
- linters:
84+
- revive
85+
path: "/common/"
86+
text: "var-naming: avoid meaningless package names"
87+
paths:
88+
- third_party$
89+
- builtin$
90+
- examples$
91+
92+
formatters:
93+
enable:
94+
- gofumpt
95+
- goimports
96+
97+
settings:
98+
goimports:
99+
local-prefixes:
100+
- github.com/oasisprotocol/cli
101+
102+
exclusions:
103+
generated: lax
104+
paths:
105+
- third_party$
106+
- builtin$
107+
- examples$

cmd/common/transaction.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ import (
77
"math"
88
"os"
99

10-
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/modules/accounts"
11-
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/modules/core"
1210
"github.com/spf13/cobra"
1311
flag "github.com/spf13/pflag"
1412

13+
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/modules/accounts"
14+
"github.com/oasisprotocol/oasis-sdk/client-sdk/go/modules/core"
15+
1516
"github.com/oasisprotocol/oasis-core/go/common/cbor"
1617
coreSignature "github.com/oasisprotocol/oasis-core/go/common/crypto/signature"
1718
consensusPretty "github.com/oasisprotocol/oasis-core/go/common/prettyprint"
@@ -587,10 +588,12 @@ func PrettyErrorHints(
587588
errMsg += "\nTip: You can get TEST tokens at https://faucet.testnet.oasis.io or #dev-central at https://oasis.io/discord."
588589
}
589590
if failedRes.Module == staking.ModuleName {
590-
if failedRes.Code == 5 {
591+
switch failedRes.Code {
592+
case 5:
591593
errMsg += "\nTip: Did you forget to run `oasis account allow`?"
592-
} else if failedRes.Code == 9 {
594+
case 9:
593595
errMsg += "\nTip: You can see minimum staking transfer amount by running `oasis network show parameters`"
596+
default:
594597
}
595598
}
596599
return errMsg

cmd/common/wallet.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ func ResolveAddress(net *configSdk.Network, address string) (*types.Address, *et
181181
if len(subs) > 2 {
182182
poolName = subs[2]
183183
}
184-
if poolKind == addressExplicitParaTime {
184+
switch poolKind {
185+
case addressExplicitParaTime:
185186
switch poolName {
186187
case poolCommon:
187188
return &accounts.CommonPoolAddress, nil, nil
@@ -196,7 +197,7 @@ func ResolveAddress(net *configSdk.Network, address string) (*types.Address, *et
196197
default:
197198
return nil, nil, fmt.Errorf("unsupported ParaTime pool: %s", poolName)
198199
}
199-
} else if poolKind == addressExplicitConsensus {
200+
case addressExplicitConsensus:
200201
var addr types.Address
201202
switch poolName {
202203
case poolBurn:
@@ -211,8 +212,9 @@ func ResolveAddress(net *configSdk.Network, address string) (*types.Address, *et
211212
return nil, nil, fmt.Errorf("unsupported consensus pool: %s", poolName)
212213
}
213214
return &addr, nil, nil
215+
default:
216+
return nil, nil, fmt.Errorf("unsupported pool kind: %s. Please use pool:<poolKind>:<poolName>, for example pool:paratime:pending-withdrawal", poolKind)
214217
}
215-
return nil, nil, fmt.Errorf("unsupported pool kind: %s. Please use pool:<poolKind>:<poolName>, for example pool:paratime:pending-withdrawal", poolKind)
216218
case addressExplicitTest:
217219
// test:alice, test:dave
218220
if testKey, ok := testing.TestAccounts[data]; ok {

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/oasisprotocol/cli
22

3-
go 1.24.0
4-
5-
toolchain go1.24.2
3+
go 1.25.4
64

75
// v1.5.0 has broken uint parsing, use a commit with the fix until the
86
// the maintainers merge the PR: https://github.com/spf13/cast/pull/144

0 commit comments

Comments
 (0)