cmd/gofmt: Slice access not being formatted to reflect operator precedence #60594
Labels
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone
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?
https://go.dev/play/p/7EnkFFdEfKt
gofmt
(or clicking the "Format" button on the link) will insert spaces between operators to indicate their precedence (line 7). However, this does not apply to a slice accessor (line 10).This can make code hard to read in more complex operations, such as converting cartesian coordinates to an index (example below.)
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: