Skip to content

Specify go and toolchain versions separately #5396

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

Closed
wants to merge 1 commit into from

Conversation

AlekSi
Copy link
Contributor

@AlekSi AlekSi commented Feb 12, 2025

That makes it easier to consume via 1.24's go tool.

@AlekSi AlekSi marked this pull request as ready for review February 12, 2025 09:15
@AlekSi AlekSi requested a review from ldez February 12, 2025 09:15
Copy link
Member

@alexandear alexandear left a comment

Choose a reason for hiding this comment

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

Could you please provide a more detailed description of the problem? It is currently difficult to understand the issue that this PR is intended to address.

@ldez ldez added the feedback required Requires additional feedback label Feb 12, 2025
@AlekSi
Copy link
Contributor Author

AlekSi commented Feb 21, 2025

Ok, actually, there is no problem (or at least I can't reproduce it anymore after switching to 1.24).
But I think it is just weird to require the 1.23.0 language version (that's what the go directive means now) and not just 1.23.
The somewhat related fix was done in #5112.

@ldez ldez added declined and removed feedback required Requires additional feedback labels Feb 21, 2025
@ldez
Copy link
Member

ldez commented Feb 21, 2025

The min Go version can be a release version or the family version, the Go documentation is not clear but this is perfectly right:

So we don't need to have an explicit toolchain version.

Thank you anyway.

@ldez ldez closed this Feb 21, 2025
@AlekSi
Copy link
Contributor Author

AlekSi commented Feb 21, 2025

I know that it can be. But I think it shouldn't be in that case: there is nothing about 1.24.0 specifically that golangci-lint requires. For example, you would want to use 1.24.1 once it is released. Then, you would update go directive to use 1.24.1 without adding toolchain directive. In turn, that would force all users of golangci-lint that specify it in the tool directive to update to 1.24.1 – and there is no reason for that if they are not affected by 1.24.0 bugs.

@ldez
Copy link
Member

ldez commented Feb 21, 2025

In fact, we don't update the min Go version with a patched version for the same reasons we are using min go 1.23 instead of go 1.24.

go install, go tool, and tools pattern are strongly discouraged ways to install golangci-lint but if some users use them, golangci-lint should not force the update of the Go version.
This is also a problem with OS distributions that are slow to update the Go versions.

https://golangci-lint.run/welcome/install/#install-from-sources

there is nothing about 1.24.0 specifically that golangci-lint requires.

This is not exactly right: golangci-lint can be compiled with go1.23 but in this case, it will not work with go1.24.

@AlekSi AlekSi deleted the toolchain branch February 21, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants