Table of Contents
Document Packages howto
ToHTML Rules from https://golang.org/pkg/go/doc/#ToHTML:
- Each span of unindented non-blank lines is converted into a single paragraph.
- 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.
- A span of indented lines is converted into a <pre> block, with the common indent prefix removed.
- URLs in the comment text are converted into links;
- Go identifiers that appear in the words map are italicized
Package documentation rules:
- A comment immediately preceding a
pacakgedeclaration is considered the document for the package
- Go doc comments are always complete sentences, and the first sentence is usually a summary that starts with the name being declared.
- Comments that are not adjacent to a top-level declaration are omitted from godoc's output, with one notable exception.
- Top-level comments that begin with the word "BUG(who)” are recognized as known bugs, and included in the "Bugs” section of the package documentation.
<name>_test.goare included as examples