cmd/gofmt: comment in return params is misplaced #28433
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What did you do?
Ran
gofmt
on this program (https://play.golang.org/p/1rASHggr4wx):What did you expect to see?
The input, unchanged.
What did you see instead?
The program reformatted with the comment in a very strange place (https://play.golang.org/p/NujRVxVN6N5):
Arguably not that common to stick a comment there, but I find the resulting code extremely surprising. Note that this nearly identical program works just fine (https://play.golang.org/p/Hpfcc5HX00l) because the presence of
bazzle
makes the parens required and so gofmt doesn't attempt a reformatting:/cc @griesemer since you seem to get pinged on all the gofmt issues eventually
The text was updated successfully, but these errors were encountered: