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

Specify golang patch version in go.mod #2938

Merged
merged 2 commits into from
Apr 12, 2024
Merged

Conversation

StephenButtolph
Copy link
Contributor

@StephenButtolph StephenButtolph commented Apr 12, 2024

Why this should be merged

As of go.1.21 - the go.mod file supports enforcing a minimum patch version.

See the go.1.21 release notes:

To improve forwards compatibility, Go 1.21 now reads the go line in a go.work or go.mod file as a strict minimum requirement: go 1.21.0 means that the workspace or module cannot be used with Go 1.20 or with Go 1.21rc1. This allows projects that depend on fixes made in later versions of Go to ensure that they are not used with earlier versions. It also gives better error reporting for projects that make use of new Go features: when the problem is that a newer Go version is needed, that problem is reported clearly, instead of attempting to build the code and printing errors about unresolved imports or syntax errors.

To make these new stricter version requirements easier to manage, the go command can now invoke not just the toolchain bundled in its own release but also other Go toolchain versions found in the PATH or downloaded on demand. If a go.mod or go.work go line declares a minimum requirement on a newer version of Go, the go command will find and run that version automatically. The new toolchain directive sets a suggested minimum toolchain to use, which may be newer than the strict go minimum. See “Go Toolchains” for details.

How this works

+ .9.

How this was tested

  • CI

@StephenButtolph StephenButtolph added this to the v1.11.5 milestone Apr 12, 2024
@StephenButtolph StephenButtolph self-assigned this Apr 12, 2024
Copy link
Contributor

@ceyonur ceyonur left a comment

Choose a reason for hiding this comment

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

👍

@StephenButtolph StephenButtolph added this pull request to the merge queue Apr 12, 2024
Merged via the queue into master with commit e2d4a56 Apr 12, 2024
18 checks passed
@StephenButtolph StephenButtolph deleted the specify-patch-in-go-mod branch April 12, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants