-
Notifications
You must be signed in to change notification settings - Fork 94
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
relax go version? #1042
Comments
Hey there @jharley 👋🏻, trying to dig through Go's documentation and some GH issues to make sure we get the right Interestingly enough, I wasn't able to generate There is a long thread on a semi-related bug that I believe doesn't exist anymore that has some interesting info: golang/go#62278. Specifically this comment summarizes what I believe is current state, which is that the Go tooling now wants our modules to specify the release language version, of which It looks like the Go team has since adjusted their tooling to be more lenient and "assume the lack of patch version == From your experience upgrading, did you run into that "toolchain not available" error message? And then a follow up |
Thanks for the speedy response and the links: this is one of those "everything I thought I knew is wrong" moments 😅 I'll adjust my project accordingly and we'll for sure be socializing this internally. |
#545 required an update to "go.mod" such that the `go` directive went from `1.22` to `1.22.0` in order to appease the compiler. This was confusing to me, so I opened hashicorp/terraform-plugin-framework#1042 and learned that things had ✨ changed ✨. Looking at the [Go documentation](https://go.dev/doc/toolchain#get) we should be using `go get go@1.X` when upgrading Go versions, and because the current `toolchain` directive value will match it is excluded. For example, the change set in this PR is from running: ``` $ go get go@1.22 go: upgraded go 1.22.0 => 1.22.7 go: removed toolchain go1.22.7 ```
With the recent release of v1.12.0, "go.mod"'s
go
directive was changed togo 1.22.0
. This has a knock-on effect of requiring any project update their directive to at least that (with the patch) as well.My understanding is that the
go
directive is used to specify the language semantics in use in the project, while thetoolchain
directive can be used to specify an exact toolchain version requirement. I think it'd be ideal to update togo 1.22
(no patch) for semantics but something liketoolchain go1.22.7
.n.b. there are a number of other Terraform-related libraries that had a similar change made to include the patch version in the
go
directive, but I thought I'd start with this one issue. :)The text was updated successfully, but these errors were encountered: