Skip to content

Conversation

@gustavosbarreto
Copy link
Contributor

@gustavosbarreto gustavosbarreto commented May 12, 2025

The GitHub Actions workflow defines:

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

Copy link
Owner

@pires pires left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a ton!

@coveralls
Copy link

coveralls commented May 13, 2025

Coverage Status

coverage: 94.136%. remained the same
when pulling 4eac547 on gustavosbarreto:main
into 2293221 on pires:main.

@pires
Copy link
Owner

pires commented May 13, 2025

Somehow, the linter is asking for go mod tidy :( WDYT?

@gustavosbarreto
Copy link
Contributor Author

I'll check this

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 pires#126
@pires
Copy link
Owner

pires commented May 14, 2025

So it seems the sums for the deps change depending on the Go version being used, am I reading the go mod tidy correctly?

@gustavosbarreto
Copy link
Contributor Author

So it seems the sums for the deps change depending on the Go version being used, am I reading the go mod tidy correctly?

Yep, even if go mod tidy doesn't change go.sum, it still refreshes the module state internally. That helps tools like golangci-lint, which rely on go list under the hood, avoid context loading errors in clean or containerized environments.

@pires pires merged commit eef9d7e into pires:main May 15, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot builld using Go <= 1.23

3 participants