Skip to content
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

go-version-file enforces the minimum required Go version instead of opting for the maximum allowed one #561

Open
azazeal opened this issue Mar 4, 2025 · 2 comments
Assignees
Labels
feature request New feature or request to improve the current logic

Comments

@azazeal
Copy link

azazeal commented Mar 4, 2025

Given the following go.mod & setup-go configurations:

module github.com/actions/setup-go/example

go 1.23.3
- name: Setup Go
  uses: actions/setup-go
  with:
    go-version-file: go.mod

the action would determine, today, that the version of Go it should setup is 1.23.3, instead of 1.24.0, which is the latest available Go version matching the go constraint the author opted for, as explained by the go directive documentation here:

go minimum-go-version

minimum-go-version
The minimum version of Go required to compile packages in this module.

Perhaps there's good reason as to why the action determines the version as it does today, and if that's the case please let me know, but I think that, when go-version-file is used, the action should opt for the greatest available Go version matching the author's specification (perhaps only in cases where check-latest is set), instead of opting for the provided minimum required version.

@azazeal azazeal added feature request New feature or request to improve the current logic needs triage labels Mar 4, 2025
@priya-kinthali
Copy link

Hello @azazeal👋,
Thank you for this feature request. We will investigate it and get back to you as soon as we have some feedback.

@azazeal
Copy link
Author

azazeal commented Mar 5, 2025

Hello @azazeal👋, Thank you for this feature request. We will investigate it and get back to you as soon as we have some feedback.

Thank you for your response. I'd also like to point out the following:

Given two different go.mod files, carrying the constraints go 1.23 & go 1.23.4, the action would determine, today and unless mistaken, the following Go versions, respectively: 1.23.6 & 1.23.4 but, perhaps, it should be 1.23.6 in both cases.

I can see how I'd like for my builds to run on the same minor version of a go.mod file (1.23 in this example), just not quite sure why adding a patch constraint to the value the go directive carries, freezes the determined version to be exactly that patch, instead of it being determined as at least that patch, especially in reference to the go directive's documentation.

This, of course, is just personal preference—just pointing it out.

@lmvysakh lmvysakh self-assigned this Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request to improve the current logic
Projects
None yet
Development

No branches or pull requests

3 participants