Skip to content

Commit 3f5f89c

Browse files
ci: use local Go toolchain and downgrade Go version
In our GitHub Actions workflow we declare: ```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 3f5f89c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.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)