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
Files may specify their own Go language version via a build tag. For instance:
//go:build go1.22
indicates that this file requires Go language version 1.22.
If the language version in the build tag contains dot-release information, say it's "go1.22.1", it is invalid.
The compiler simply ignores the version (it doesn't use, say "go1.22").
It seems (to me) that this shouldn't be silently ignored as it might be very confusing for users. go vet might be the right tool to report an error. Alternatively, the compiler could report an error, but generally, the compiler doesn't complain about errors in (pragma and build) comments.
The text was updated successfully, but these errors were encountered:
It should report any Go version string that is silently dropped and ignored.
Also, before anybody starts working on this: note this is a proposal and needs to be discussed by the proposal review committee first. Thanks.
Files may specify their own Go language version via a build tag. For instance:
//go:build go1.22
indicates that this file requires Go language version 1.22.
If the language version in the build tag contains dot-release information, say it's "go1.22.1", it is invalid.
The compiler simply ignores the version (it doesn't use, say "go1.22").
It seems (to me) that this shouldn't be silently ignored as it might be very confusing for users.
go vet
might be the right tool to report an error. Alternatively, the compiler could report an error, but generally, the compiler doesn't complain about errors in (pragma and build) comments.The text was updated successfully, but these errors were encountered: