On Wed, Apr 19, 2023 at 2:11 PM Marc Adkins <m...@doorways.org> wrote:
>
> I like gofmt a lot. I'm not as happy with godoc. Apparently the in the 1.19 
> release gofmt started reformatting comments to be consistent with godoc. I 
> missed this in the release notes (which I may not have read, mea culpa).
>
> For a long time this wasn't an issue for me but recently I've had gofmt "fix" 
> something that IMHO wasn't broken (and in the process break it for my 
> purposes). OK, it's a weird edge case related to specially formatted comments 
> that are important to my IDE. So not all that important.
>
> Still, I'd like to be able to turn off comment reformatting. I've looked but 
> there doesn't seem to be a gofmt flag to avoid comments being reformatted for 
> godoc. Am I missing something?

You aren't missing anything.  The philosophy here is that this
reformatting, which only applies to doc comments, will ensure that the
comment looks acceptable as a comment, as HTML, as Markdown, and as
plain text.  That necessarily restricts the kinds of things that can
appear.  The exact docs are at https://go.dev/doc/comment.

If you give us more details perhaps there is some common ground
available.  In particular, a sequence of lines where each line is
indented will be treated as a code block, and not reformatted.

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVB33xE45G620-Rpxs9vehkxjkm3ZQ16_M_XUubdJqHNA%40mail.gmail.com.

Reply via email to