Package doc
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
pacakge
declaration is considered the document for the package
// Package sort provides primitives for sorting slices and user-defined
// collections.
package sort
- Go doc comments are always complete sentences, and the first sentence is usually a summary that starts with the name being declared.
// Fprint formats using the default formats for its operands and writes to w.
// Spaces are added between operands when neither is a string.
// It returns the number of bytes written and any write error encountered.
func Fprint(w io.Writer, a ...interface{}) (n int, err error) {
- 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.
Example<Name>
functions in<name>_test.go
are included as examples