cmd/gofmt: Inconsistent formatting of spaces around arithmetic operators #45301
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
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?
Formatting with
go fmt
produces inconsistent behavior with artihmetic operators.It can be demonstrated by pressing "Format" in the playground:
https://play.golang.org/p/cndVAXH0oD8
It does nothing, but two usages of
1 * time.Second
and1 + 1
have different formatting.What did you expect to see?
What did you see instead?
If I had to choose, I'd go for having spaces around the operators, ie.
1 * time.Second
and1 + 1
.The text was updated successfully, but these errors were encountered: