Skip to content

fix: update to go1.25.8, and use separate .go-version file#2246

Merged
Subserial merged 1 commit intogoogle:mainfrom
thaJeztah:go_version_file
Mar 30, 2026
Merged

fix: update to go1.25.8, and use separate .go-version file#2246
Subserial merged 1 commit intogoogle:mainfrom
thaJeztah:go_version_file

Conversation

@thaJeztah
Copy link
Copy Markdown
Contributor

Commit bf0f710 removed the patch version from go.mod, but overlooked that the go-setup action in github actions workflows were configured to use 'go.mod' for its version.

Unfortunately, go-setup action (incorrectly) uses the specified version as an exact version, not as minimum, which meant that actions (and release flows) would now downgrade to go1.25.0;

Run actions/setup-go@v6
Setup go version spec 1.25.0
Attempting to download 1.25.0...
matching 1.25.0...
Acquiring 1.25.0 from https://github.com/actions/go-versions/releases/download/1.25.0-16925932082/go-1.25.0-linux-x64.tar.gz
Extracting Go...
...
go version go1.25.0 linux/amd64

This patch:

  • Adds a dedicated .go-version file, which specifies the version of go to use, independently from the version in go.mod (which defines the minimum supported version).
  • Sets GOTOOLCHAIN=local to prevent changes in go.mod from implicitly updating the go version to a newer version.

@thaJeztah
Copy link
Copy Markdown
Contributor Author

cc @Subserial @howardjohn

Comment on lines +7 to +8
env:
GOTOOLCHAIN: local
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Setting GOTOOLCHAIN: local, which isn't set by go-setup action; without it, you may see go-setup action installing version X, then running go --version which automatically downloads a newer version if set in go.mod 🫠

Comment thread .go-version
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Mar 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.74%. Comparing base (8b3c303) to head (9088874).
⚠️ Report is 78 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (8b3c303) and HEAD (9088874). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (8b3c303) HEAD (9088874)
2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2246       +/-   ##
===========================================
- Coverage   71.67%   52.74%   -18.94%     
===========================================
  Files         123      164       +41     
  Lines        9935    11113     +1178     
===========================================
- Hits         7121     5861     -1260     
- Misses       2115     4546     +2431     
- Partials      699      706        +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Subserial
Copy link
Copy Markdown
Contributor

Thank you! I was going to try manually setting the version instead of the file.

Could you add the comment to go.mod about .go-version that you suggested?

@thaJeztah
Copy link
Copy Markdown
Contributor Author

Yeah, probably never hurts to be explicit and to prevent someone accidentally updating; let me try draft a comment 😅

@thaJeztah
Copy link
Copy Markdown
Contributor Author

OK; done! Let me know if the wording looks good to you; happy do update 😅

Comment thread .github/workflows/release.yml Outdated
@@ -19,6 +22,7 @@ jobs:
with:
go-version: 1.25
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a reason the releaser action should use a different fixed version? I think it should be fine to use the global version.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oh, no, don't think there is, but I probably missed it when searching?

Let me look when I get back at my computer

Commit bf0f710 removed the patch
version from go.mod, but overlooked that the go-setup action in
github actions workflows were configured to use 'go.mod' for its
version.

Unfortunately, go-setup action (incorrectly) uses the specified
version as an exact version, not as minimum, which meant that
actions (and release flows) would now downgrade to go1.25.0;

    Run actions/setup-go@v6
    Setup go version spec 1.25.0
    Attempting to download 1.25.0...
    matching 1.25.0...
    Acquiring 1.25.0 from https://github.com/actions/go-versions/releases/download/1.25.0-16925932082/go-1.25.0-linux-x64.tar.gz
    Extracting Go...
    ...
    go version go1.25.0 linux/amd64

This patch:

- Adds a dedicated `.go-version` file, which specifies the version
  of go to use, independently from the version in `go.mod` (which
  defines the minimum supported version).
- Sets GOTOOLCHAIN=local to prevent changes in `go.mod` from implicitly
  updating the go version to a newer version.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Comment on lines 22 to +25
with:
go-version: 1.25
check-latest: true
go-version-file: '.go-version'
check-latest: true # no-op if full version is specified
cache: false
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I updated the release as well; so what I THINK was the thought behind it;

  • go.mod specifying the version to run in CI
  • release to be specified without patch version, then leaving it to go-setup-action to find "latest patch"

Advantage is that releases would be built with latest patch available at the time (in case it was forgotten to update the version).

Downside is that A) it's not deterministic, B) CI would have tested a different version than the release uses.

But there's clearly pros/cons to either. I left the check-latest: true in place, but it would be a no-op if a full version is specified, but probably won't hurt to have either.

@Subserial Subserial merged commit c99e7cf into google:main Mar 30, 2026
18 of 19 checks passed
@thaJeztah thaJeztah deleted the go_version_file branch March 30, 2026 18:24
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.

3 participants