Skip to content

Commit d217b56

Browse files
authored
Merge pull request #6295 from oasisprotocol/andrej/feature/bump-go-1.25
go: Bump Go to 1.25
2 parents 6097f0a + aa2619f commit d217b56

14 files changed

Lines changed: 126 additions & 105 deletions

File tree

.changelog/6295.internal.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
go: Bump Go to 1.25

.github/workflows/ci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Set up Go
4747
uses: actions/setup-go@v5
4848
with:
49-
go-version: "1.24.x"
49+
go-version: "1.25.x"
5050
- name: Set up Rust
5151
run: rustup show
5252
- name: Install dependencies

.github/workflows/ci-reproducibility.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Set up Go
4040
uses: actions/setup-go@v5
4141
with:
42-
go-version: "1.24.x"
42+
go-version: "1.25.x"
4343
- name: Set up Rust
4444
working-directory: build${{ matrix.build_number }}
4545
run: rustup show

.github/workflows/release-dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Set up Go
3636
uses: actions/setup-go@v5
3737
with:
38-
go-version: "1.24.x"
38+
go-version: "1.25.x"
3939
- name: Set up Rust
4040
run: rustup show
4141
- name: Install Oasis Node prerequisites

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Set up Go
3939
uses: actions/setup-go@v5
4040
with:
41-
go-version: "1.24.x"
41+
go-version: "1.25.x"
4242

4343
- name: Set up Rust
4444
run: rustup show

docker/oasis-core-dev/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
FROM ubuntu:22.04
22

33
# Package versions.
4-
ARG GO_VERSION=1.24.0
4+
ARG GO_VERSION=1.25.0
55
ARG GO_NANCY_VERSION=1.0.33
66
ARG GO_NANCY_CHECKSUM=a4bf5290d41b095c04f941ed5380674770c79d59735e33b1bd07a5cd5fbb135d
77
ARG GO_PROTOC_VERSION=3.6.1
88
ARG GO_PROTOC_GEN_GO_VERSION=1.21.0
9-
ARG GOLANGCILINT_VERSION=1.64.5
9+
ARG GOLANGCILINT_VERSION=2.3.1
1010
ARG GOCOVMERGE_VERSION=b5bfa59ec0adc420475f97f89b58045c721d761c
11-
ARG GOFUMPT_VERSION=v0.7.0
12-
ARG GOIMPORTS_VERSION=v0.30.0
11+
ARG GOFUMPT_VERSION=v0.8.0
12+
ARG GOIMPORTS_VERSION=v0.36.0
1313
ARG RUST_NIGHTLY_VERSION=2025-02-22
1414
ARG JEMALLOC_VERSION=5.2.1
1515
ARG JEMALLOC_CHECKSUM=34330e5ce276099e2e8950d9335db5a875689a4c6a56751ef3b1d8c537f887f6
@@ -67,9 +67,9 @@ RUN wget https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \
6767
mkdir -p /go/bin && \
6868
# Install a specific version of protoc-gen-go.
6969
go install google.golang.org/protobuf/cmd/protoc-gen-go@v${GO_PROTOC_GEN_GO_VERSION} && \
70-
# Install golangci-lint.
71-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /tmp/bin v${GOLANGCILINT_VERSION} && \
72-
mv /tmp/bin/golangci-lint /go/bin && \
70+
# Install golangci-lint from source because the binaries might not have been built
71+
# with the latest Go version, which is a problem when bumping Go.
72+
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v${GOLANGCILINT_VERSION} && \
7373
# Install gocovmerge for e2e coverage.
7474
go install github.com/wadey/gocovmerge@${GOCOVMERGE_VERSION} && \
7575
# Install nancy for auditing dependencies.

docs/development-setup/prerequisites.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Core:
4040
```
4141
<!-- markdownlint-enable line-length -->
4242

43-
* [Go] (at least version 1.24.0).
43+
* [Go] (at least version 1.25.0).
4444

4545
If your distribution provides a new-enough version of Go, just use that.
4646

@@ -52,18 +52,18 @@ Core:
5252
* [ensure `$GOPATH/bin` is in your `PATH`](
5353
https://tip.golang.org/doc/code.html#GOPATH),
5454
* [install the desired version of Go](
55-
https://golang.org/doc/install#extra_versions), e.g. 1.24.0, with:
55+
https://golang.org/doc/install#extra_versions), e.g. 1.25.0, with:
5656

5757
```
58-
go install golang.org/dl/go1.24.0@latest
59-
go1.24.0 download
58+
go install golang.org/dl/go1.25.0@latest
59+
go1.25.0 download
6060
```
6161
6262
* instruct the build system to use this particular version of Go by setting
6363
the `OASIS_GO` environment variable in your `~/.bashrc`:
6464
6565
```
66-
export OASIS_GO=go1.24.0
66+
export OASIS_GO=go1.25.0
6767
```
6868
6969
* [Rust].
@@ -137,8 +137,8 @@ Core:
137137
Download and install it with:
138138
139139
```
140-
${OASIS_GO:-go} install mvdan.cc/gofumpt@v0.7.0
141-
${OASIS_GO:-go} install golang.org/x/tools/cmd/goimports@v0.30.0
140+
${OASIS_GO:-go} install mvdan.cc/gofumpt@v0.8.0
141+
${OASIS_GO:-go} install golang.org/x/tools/cmd/goimports@v0.36.0
142142
```
143143
144144
* (**OPTIONAL**) [golangci-lint].
@@ -151,7 +151,7 @@ Core:
151151
```
152152
curl -sSfL \
153153
https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
154-
| sh -s -- -b $(${OASIS_GO:-go} env GOPATH)/bin v1.64.5
154+
| sh -s -- -b $(${OASIS_GO:-go} env GOPATH)/bin v2.3.1
155155
```
156156
157157
* (**OPTIONAL**) [protoc-gen-go].

go/.golangci.yml

Lines changed: 97 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,115 @@
1-
linters-settings:
2-
goconst:
3-
ignore-tests: true
4-
ignore-strings: "unix:.*"
5-
goimports:
6-
# Put local imports after 3rd-party packages.
7-
local-prefixes: github.com/oasisprotocol/oasis-core
8-
gosec:
9-
excludes:
10-
# https://github.com/securego/gosec#available-rules
11-
- G402
12-
- G404
13-
- G115 # Integer conversion with overflow check; many false positives
14-
govet:
15-
shadow: true
16-
# Enable once suggested fixes are shown: https://github.com/golangci/golangci-lint/issues/2134
17-
#enable:
18-
# - fieldalignment
19-
depguard:
20-
rules:
21-
main:
22-
files:
23-
- $all
24-
allow:
25-
- $gostd
26-
- github.com/a8m/envsubst
27-
- github.com/btcsuite/btcutil
28-
- github.com/cenkalti/backoff/v4
29-
- github.com/cometbft/cometbft
30-
- github.com/cosmos/gogoproto/proto
31-
- github.com/dgraph-io/badger/v4
32-
- github.com/eapache/channels
33-
- github.com/fxamacker/cbor/v2
34-
- github.com/gammazero/deque
35-
- github.com/go-kit/log
36-
- github.com/goki/go-difflib
37-
- github.com/golang/protobu
38-
- github.com/golang/snappy
39-
- github.com/google/btree
40-
- github.com/hashicorp/go-hclog
41-
- github.com/hashicorp/go-plugin
42-
- github.com/hpcloud/tail
43-
- github.com/ipfs/go-log/v2
44-
- github.com/libp2p/go-libp2p
45-
- github.com/multiformats/go-multiaddr
46-
- github.com/oasisprotocol
47-
- github.com/olekukonko/tablewriter
48-
- github.com/powerman/rpc-codec
49-
- github.com/prometheus
50-
- github.com/seccomp/libseccomp-golang
51-
- github.com/spf13
52-
- github.com/stretchr
53-
- github.com/tidwall/btree
54-
- github.com/tyler-smith/go-bip39
55-
- github.com/mdlayher/vsock
56-
- github.com/nxadm/tail
57-
1+
version: "2"
582
linters:
59-
disable-all: true
3+
default: none
604
enable:
615
- bodyclose
626
- copyloopvar
637
- depguard
648
- errcheck
659
- goconst
6610
- gocyclo
67-
- gofumpt
68-
- goimports
6911
- goprintffuncname
7012
- gosec
71-
- gosimple
7213
- govet
7314
- ineffassign
7415
- misspell
7516
- revive
7617
- rowserrcheck
7718
- staticcheck
78-
- typecheck
7919
- unconvert
8020
- unused
81-
82-
run:
83-
84-
exclude-use-default: false
85-
86-
issues:
87-
include:
88-
- EXC0014 # un-exclude revive `exported` which warns about incorrect comments on exported items.
89-
exclude:
90-
- context-as-argument # revive
91-
exclude-dirs:
92-
# golang-ci-lint requires that files compile for certain linters
93-
# to run, and Go plugins do not compile unless `-buildmode=plugin`
94-
# is set, which linters do not do.
95-
- oasis-test-runner/scenario/pluginsigner/example_signer_plugin
21+
settings:
22+
depguard:
23+
rules:
24+
main:
25+
list-mode: lax
26+
files:
27+
- $all
28+
allow:
29+
- $gostd
30+
- github.com/a8m/envsubst
31+
- github.com/btcsuite/btcutil
32+
- github.com/cenkalti/backoff/v4
33+
- github.com/cometbft/cometbft
34+
- github.com/cosmos/gogoproto/proto
35+
- github.com/dgraph-io/badger/v4
36+
- github.com/eapache/channels
37+
- github.com/fxamacker/cbor/v2
38+
- github.com/gammazero/deque
39+
- github.com/go-kit/log
40+
- github.com/goki/go-difflib
41+
- github.com/golang/protobu
42+
- github.com/golang/snappy
43+
- github.com/google/btree
44+
- github.com/hashicorp/go-hclog
45+
- github.com/hashicorp/go-plugin
46+
- github.com/hpcloud/tail
47+
- github.com/ipfs/go-log/v2
48+
- github.com/libp2p/go-libp2p
49+
- github.com/multiformats/go-multiaddr
50+
- github.com/oasisprotocol
51+
- github.com/olekukonko/tablewriter
52+
- github.com/powerman/rpc-codec
53+
- github.com/prometheus
54+
- github.com/seccomp/libseccomp-golang
55+
- github.com/spf13
56+
- github.com/stretchr
57+
- github.com/tidwall/btree
58+
- github.com/tyler-smith/go-bip39
59+
- github.com/mdlayher/vsock
60+
- github.com/nxadm/tail
61+
goconst:
62+
ignore-string-values: unix:.*
63+
gosec:
64+
excludes:
65+
- G402
66+
- G404
67+
- G115
68+
revive:
69+
rules:
70+
- name: exported
71+
disabled: true
72+
staticcheck:
73+
checks:
74+
- all
75+
- -QF1001
76+
- -QF1002
77+
- -QF1003
78+
- -QF1006
79+
- -QF1008
80+
- -ST1000
81+
- -ST1003
82+
- -ST1019
83+
- -S1000
84+
exclusions:
85+
generated: lax
86+
presets:
87+
- common-false-positives
88+
- legacy
89+
- std-error-handling
90+
rules:
91+
- path: (.+)\.go$
92+
text: context-as-argument
93+
- linters:
94+
- goconst
95+
path: (.+)_test\.go
96+
paths:
97+
- oasis-test-runner/scenario/pluginsigner/example_signer_plugin
98+
- third_party$
99+
- builtin$
100+
- examples$
101+
formatters:
102+
enable:
103+
- gofumpt
104+
- goimports
105+
settings:
106+
goimports:
107+
local-prefixes:
108+
- github.com/oasisprotocol/oasis-core
109+
exclusions:
110+
generated: lax
111+
paths:
112+
- oasis-test-runner/scenario/pluginsigner/example_signer_plugin
113+
- third_party$
114+
- builtin$
115+
- examples$

go/beacon/api/api.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ type ConsensusParameters struct {
144144
}
145145

146146
// Interval returns the epoch interval (in blocks).
147-
func (cp *ConsensusParameters) Interval() int64 {
148-
switch cp.Backend {
147+
func (p *ConsensusParameters) Interval() int64 {
148+
switch p.Backend {
149149
case BackendInsecure:
150-
return cp.InsecureParameters.Interval
150+
return p.InsecureParameters.Interval
151151
case BackendVRF:
152-
return cp.VRFParameters.Interval
152+
return p.VRFParameters.Interval
153153
default:
154154
panic("invalid backend")
155155
}

go/common/logging/logging.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func Initialize(w io.Writer, format Format, defaultLvl Level, moduleLvls map[str
245245
return fmt.Errorf("logging: already initialized")
246246
}
247247

248-
var logger log.Logger = backend.baseLogger
248+
logger := backend.baseLogger
249249
if w != nil {
250250
w = log.NewSyncWriter(w)
251251
switch format {

0 commit comments

Comments
 (0)