You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments