Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/gofmt: weird indentation with block comments #18791
Please answer these questions before submitting your issue. Thanks!
What did you do?
Block comments are formatted weirdly.
What did you expect to see?
Comment beginner and ender is aligned correctly even though it requires adding indentation with spaces.
@rakyll It's very tricky to get this right. If the "line of stars" is aligned to start with, it works out most of the time. The problem is recognizing the "line of stars" as a line and not interfere when it's not. There's some support for the argument that gofmt should never touch comment internals in the first place. Fixing this requires meddling with the inside text of a /*-comment. Sometimes the heuristic will be wrong.