On Wed, Apr 18, 2018 at 10:37:26PM -0700, Chris FractalBach wrote:
> So, I'm one of those people who sometimes adds comments like this to my 
> code:
> 
> +------------------------------------+
> |           Program Title            |
> |               Author               |
> |                Date                |
> +------------------------------------+
>  Synopsis, Description, etc.
> ______________________________________
> 
> 
> However, adding comments like this into Go code often ruins the 
> documentation, so I have been avoiding it.
> Are there any solutions to get the best of both worlds?

If you indent that part of the comment it should end up in a <pre> block.

Do note that godoc does give you headers if you do this:

> Each span of unindented non-blank lines is converted into a single paragraph.
> There is one exception to the rule: a span that consists of a single line, is
> followed by another paragraph span, begins with a capital letter, and contains
> no punctuation is formatted as a heading. 
https://golang.org/pkg/go/doc/#ToHTML

Maybe that helps enough.

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to