fix go version in go.mod
Purpose of this PR
When trying to run go commands in the project on a previous version of Go, it tries to automatically download the desired version in go.mod. However, the entire version string is necessary for this to work.
before the change
$ go version
go: downloading go1.22 (darwin/arm64)
go: download go1.22 for darwin/arm64: toolchain not available
after the change
$ go version
go: downloading go1.22.0 (darwin/arm64)
go version go1.22.0 darwin/arm64
Change Category
Indicate the type of change by marking the applicable boxes:
- [x] Bugfix (non-breaking change which fixes an issue)
- [ ] Feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that could affect existing functionality)
- [ ] Documentation update
Rationale
Checklist
Before submitting your PR, please review the following:
- [x] I have conducted a self-review of my own code.
- [x] I have updated documentation accordingly.
- [x] I have added tests that prove my changes are effective or that my feature works.
- [x] Existing unit tests pass locally with my changes.
Additional Notes
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign vara-bonthu for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
Including the minor version number seems unnecessary. Is it something that only started happening for Go 1.22?
Including the minor version number seems unnecessary. Is it something that only started happening for Go 1.22?
I agree. Apparently beginning with release 1.21, the first release included a minor version number (1.21.0 as opposed to just 1.20), which is partially what leads to this issue. After a bit more research, this has been fixed in go, but only available as of 1.21.11 and 1.22.4.
Given that, it's likely fine not merging this as the impact is low. If we do merge it in, it looks like most folks specify 1.22.0 as opposed to the minor release version as the .0 is the first toolchain of the language version (and what the above patch will do if it's not present as well).
Closing per conversation above.