-
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
require Go 1.22 and use go/version for Options.LangVersion
This is a Go API breaking change; where existing users could use strings such as "1.16" or "v1.16", they should now use "go1.16". Note that the "go" prefix is mandatory, following go/version. I considered a softer landing to manipulate the older string formats to conform to the new format, but given how go/version is strict and Go versions are now clearly defined differently from SemVer, it seems best to draw a line and follow go/version's notion of validity. Supporting "go1.16" alongside "v1.16" could also cause confusion in the long run, as Go versions are subtly different from SemVer in terms of validity and order. Requiring the "go" prefix avoids footguns. Most gofumpt CLI users shouldn't be using the -lang CLI flag directly, as by default it grabs its value from the go directive in go.mod. Hence, most gofumpt CLI users should not be affected by this breakage. Go API users, such as tool or IDE integration authors, are more likely to get broken as the API falls back to assuming a conservative Go 1.0. Fixing the breakage is rather simple, as shown by the changes below. While here, suggest `go list -m` rather than `go mod edit -json`, as the latter requires using `jq` to obtain just one field. We still mention the latter command as an alternative.
- Loading branch information
Showing
8 changed files
with
40 additions
and
46 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module mvdan.cc/gofumpt | ||
|
||
go 1.21 | ||
go 1.22 | ||
|
||
require ( | ||
github.com/go-quicktest/qt v1.101.0 | ||
|
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
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