How to Write Godoc Comments in Go

Write godoc comments as block comments immediately preceding a declaration, starting with the capitalized name of the entity.

Write godoc comments as block comments (/* ... */ or // ...) immediately preceding a declaration, starting with the capitalized name of the entity being documented. The first sentence of the comment serves as the summary and must be a complete sentence that ends with a period.

// Int represents a signed multi-precision integer.
// The zero value for an Int represents the value 0.
type Int struct {
	i    C.mpz_t
	init bool
}

// NewInt returns a new Int initialized to x.
func NewInt(x int64) *Int { return new(Int).SetInt64(x) }