-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: add missing space if any in beginning of comment #30540
Comments
A similar proposal here #27949 which has been rejected. On the same vein, since the language spec does not say anything about what goes inside comments, I don't think gofmt should mess with it. There are also valid comments like /cc @griesemer for decision. |
What @agnivade said. Also, what about comments such as I agree that it would be nice if gofmt would "clean up" messy comments. In fact it already does try to align stars in comments such as /* bla bla bla
* ...
* ...
*/ but it doesn't always work and it's not clear it was a good idea in the first place. I'm hesitant to interfere more with the contents of comments at this point. Thanks for the suggestion, but I'd rather not add another somewhat ad-hoc heuristic. There will be just too many exceptions to the rule. |
I think |
As @griesemer has already said, there are too many ways this can go wrong. Different people have different preferences for comments. And adding special handling inside method and struct fields would unnecessarily add more complexity. |
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://play.golang.org/p/N4WdI_Bjdpq
What did you expect to see?
space in beginning of comment
What did you see instead?
The text was updated successfully, but these errors were encountered: