-
-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Go 1.21 changed the meaning of the "go" statement in go.mod files to enforce a minimum toolchain version, as opposed to a maximum language version. This means we no longer need the '-go' CLI flag to be able to specify the minimum targeted Go version. Furthermore, go/types.Config gained a GoVersion field and its value gets propagated to go/types.Package.GoVersion, which means that we no longer need per-analyzer "go" flags to access the targeted Go version. Go 1.22 expanded go/types to report per-file versions (as //go:build lines in individual files can downgrade and upgrade to different Go versions), which means that we no longer need to parse these lines manually. Go 1.22 also added the go/version package to allow comparing string-based Go versions. This means we no longer need to parse strings to turn them into integers. We update our tests to be grouped by Go versions, to ensure that checks work with the intended minimum versions of Go and to make it easier to test version-specific behavior. Each tested Go version for a check is treated as its own module. To avoid checking in actual go.mod files, we use go/packages.Config.Overlay to synthesize them. This requires updating to the latest commit of x/tools which includes a fix for synthesizing go.mod files. Closes: gh-105 Closes: gh-1464 Closes: gh-1463
- Loading branch information
Showing
378 changed files
with
562 additions
and
729 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.