Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/packages: pass go list-reported Go language version to type checker
Type checking of a package depends on the Go language version in effect for that package. We have been not setting it and assuming "latest" is good enough, but that is likely to become untrue in the future, and it violates Go 1.21's emphasis on forward compatibility, namely tools recognizing when they shouldn't be processing newer code. Pass the Go version along from go/packages to go/types, to allow go/types to apply the version when type-checking. This is tested by CL 507880. For golang/go#61174. Change-Id: I49353dede9c7c095c2cd0c4a6959f9f6e6a06ec5 Reviewed-on: https://go-review.googlesource.com/c/tools/+/507879 gopls-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org>
- Loading branch information