Skip to content

Commit eef9d7e

Browse files
gustavosbarretopires
authored andcommitted
ci: use local Go toolchain and downgrade Go version
The GitHub Actions workflow defines: ```yaml strategy: matrix: go: ['1.23', '1.24'] ``` However, the `1.23` job still ends up running Go `1.24`. By default, `actions/setup-go` leaves `GOTOOLCHAIN=auto`, causing go itself to fetch the version specified in `go.mod` instead instead of sticking to exactly `1.23`. This led to a false positive in CI: it appeared as if the matrix was testing Go `1.23`, when in reality all jobs were using Go `1.24`. To fix this, we need to force the use of the local Go toolchain in the CI test workflow to ensure the use of the locally installed Go version and avoid automatic downloads by `setup-go`. Also downgrades the Go version in `go.mod` from `1.24` to `1.23` to ensure compatibility with environments that do not yet support Go `1.24`. Fixes #126
1 parent 2293221 commit eef9d7e

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,19 @@ jobs:
2020
golangci:
2121
name: lint
2222
runs-on: ubuntu-latest
23+
env:
24+
GOTOOLCHAIN: local
2325
strategy:
2426
matrix:
25-
go: ['1.24']
27+
go: ['1.23', '1.24']
2628
steps:
29+
- uses: actions/checkout@v4
2730
- uses: actions/setup-go@v5
2831
with:
2932
go-version: ${{ matrix.go }}
30-
- uses: actions/checkout@v4
33+
34+
- name: Tidy
35+
run: go mod tidy
3136

3237
- name: Format
3338
run: go fmt

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
jobs:
88
test:
99
runs-on: ubuntu-latest
10+
env:
11+
GOTOOLCHAIN: local
1012
strategy:
1113
fail-fast: false
1214
matrix:

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/pires/go-proxyproto
22

3-
go 1.24
3+
go 1.23
44

55
require golang.org/x/net v0.39.0
66

0 commit comments

Comments
 (0)