New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/gofmt: change in exponent literal notation from 1.12 to 1.13 #32580
Comments
I think this was an intentional change. CC @griesemer |
any rationale or reference for the change? dueling gofmt across releases makes for unhappy CI and contributors. If the benefit is significant, changes make sense, but I'm not seeing it here. |
Correct. This was done on purpose. We do the same for prefixes, e.g. Closing as working as intended. |
@liggitt My apologies. With the proliferation of new number formats that are permitted, we (I mean several people in the Go team) felt that it would be good for I understand the unhappy CI - but that would be the case for any |
Yes, though usually the cost is easier to bear given the improved readability. The benefit here wasn't as obvious (we only had exponents in our codebase) Digging into the change, it looks like this is normalizing where no normalization previously occurred, so the output of 1.13 will still be acceptable to 1.12, which reduces my concern (versions of gofmt flipping opinions about the "right" formatting makes backports to branches built with different go versions painful) |
Correct. The new |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Ran
go fmt
on 1.12.Ran
go fmt
on 1.13.What did you expect to see?
Results to be consistent.
What did you see instead?
Exponent numbers were normalized differently:
1.12:
100E6
1.13:
100e6
The text was updated successfully, but these errors were encountered: