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: indenting removed from multi-line bullet-lists inside numbered lists #56072
Comments
I'm fairly sure that this is a duplicate of #55990. Even if the case is not exactly the same, the two issues seem to be about gofmt and the indentation of bulleted lists, so I think using a single issue will be less confusing. |
I saw that one, but that one looks like it's trying nested bullet-lists, which are documented as not supported;
So the alternative suggested there is to use a numbered list, and embed the bullet list in it. That said, it could definitely have the same cause. The "interesting" bit is that it does format the first lines of the bullet list correctly, so I wonder if the bug is cause by the formatter taking the indentation level of the outer list, and applying it to those "second" lines. I must admit that I haven't looked at the formatting code at all though 😅 |
You're right, that issue was about nested lists, I forgot that. |
Change https://go.dev/cl/446775 mentions this issue: |
@HeCorr Please paste plain text as plain text, not images. Images are much harder to read. Thanks. The change you are describing is documented at https://go.dev/doc/go1.19#go-doc. The links there explain how you can get doc comments that format correctly in both text and HTML. |
I'm closing this issue because the comment is working according to the current doc comment formatting rules. |
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?
Given the following file;
Running
gofmt
reformat the bullet-list, removing the indentation for bullets spanning multiple lines;I also tried adding whitespace after the bullet-list (following the example at https://go.dev/doc/comment#mistakes):
But this gave the same result;
What did you expect to see?
The indentation preserved.
What did you see instead?
The indentation removed.
The text was updated successfully, but these errors were encountered: