On playground (and elsewhere), this code
package main
func main() {
for i := 0; i < 1 /* 9000 */ ; i++ {
_ = i
}
}
is transformed by gofmt into this code:
package main
func main() {
for i := 0; i < 1; /* 9000 */ i++ {
_ = i
}
}
It has swapped the comment and the nearby semi-colon.
This code arises when temporarily changing the limit of a loop.
I think this swap changes the context of the comment, possibly changing its meaning.
It also means that I'll have to swap 9000 (in this example) and the semi-colon back when restoring the original loop limit.
On playground (and elsewhere), this code
is transformed by gofmt into this code:
It has swapped the comment and the nearby semi-colon.
This code arises when temporarily changing the limit of a loop.
I think this swap changes the context of the comment, possibly changing its meaning.
It also means that I'll have to swap 9000 (in this example) and the semi-colon back when restoring the original loop limit.