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: unexpected comment indentation #22408
Comments
The alignment is broken if there is a line without a comment, I believe. Are you suggesting that the design should be different? Have you thought of a change to the rule in particular? |
I am suggesting that the alignment shouldn't be broken unless there is a new line. |
I see this as working as intended. Each set of end-of-line comments will be aligned as a unit. A missing comment initiates a new unit. |
What @robpike said. |
To clarify: gofmt handled comments like this from day one and it is by design: A "column" of things (comments in this case) ends whenever the thing in question is missing on a new line. There are other mechanisms that end a column (e.g. indentation of a block), but if you want the comment column to continue, you need to add an (empty) comment where there's none in this case. I can see that aligning all comments in this case looks nicer. |
Although I was expecting it to be:
/cc @griesemer
The text was updated successfully, but these errors were encountered: