New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More specific handling/detection of Go toolchain versions #457
Labels
feature request
New feature or request to improve the current logic
Comments
matthewhughes934
added
feature request
New feature or request to improve the current logic
needs triage
labels
Feb 14, 2024
Hello @matthewhughes934 |
vincenthsh
added a commit
to vincenthsh/fogg
that referenced
this issue
Apr 24, 2024
switch off of `go-version-file` in the Github Actions, because it doesn't work great with the new `go mod tidy` format that go 1.22 does. See: * [Improve toolchain handling actions/setup-go#460](actions/setup-go#460) * [More specific handling/detection of Go toolchain versions actions/setup-go#457](actions/setup-go#457)
vincenthsh
added a commit
to vincenthsh/fogg
that referenced
this issue
Apr 24, 2024
switch off of `go-version-file` in the Github Actions, because it doesn't work great with the new `go mod tidy` format that go 1.22 does. See: * [Improve toolchain handling actions/setup-go#460](actions/setup-go#460) * [More specific handling/detection of Go toolchain versions actions/setup-go#457](actions/setup-go#457)
vincenthsh
added a commit
to vincenthsh/fogg
that referenced
this issue
Apr 24, 2024
switch off of `go-version-file` in the Github Actions, because it doesn't work great with the new `go mod tidy` format that go 1.22 does. See: * [Improve toolchain handling actions/setup-go#460](actions/setup-go#460) * [More specific handling/detection of Go toolchain versions actions/setup-go#457](actions/setup-go#457)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description:
The goal is to just have an approach to manage toolchain installs, the following is a suggestion and open to discussion/changes:
GOTOOLCHAIN=local
in the environment, see docs)go-version-file
, and:The file has a
toolchain
directive: then use that since the docs sayThis is in comparison with the
go
version, which is the minimum version of Go required to install the module (the assumption being: we're working within the module, not install it)The file has no
toolchain
directive: then use the version from thego
directive (current behaviour)Justification:
At the moment this action does not consider toolchain versions. This leads to:
1.21.0
) but yourgo.mod
contains a toolchain directive for a newer version (e.g.1.22.0
) then, without any other configuration/environment setup, anygo
commands will be run usinggo 1.22.0
You can see this in this example repo, which is just a repo with a
go.mod
whosego
directive is1.21.0
and whose toolchain directive is1.22.0
and some actions that display the version of Go under some conditions, of interest is when we specify the action with version1.21.0
: we ask for1.21.0
but a toolchain install will result in1.22.0
being installed and runAre you willing to submit a PR?
Yep, but there should be some discussion around which approach to take before implementing anything
EDIT: I noticed that the official Go docker images also set
GOTOOLCHAIN=local
https://github.com/docker-library/golang/blob/dae3405a325073e8ad7c8c378ebdf2540d8565c4/Dockerfile-linux.template#L162C3-L163C1 with some discussion on the linked issue there: docker-library/golang#472The text was updated successfully, but these errors were encountered: