Documentation
¶
Overview ¶
Package check ensures that Go exported symbols and the package include documentation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrCommentPrefix = errors.New("invalid comment prefix")
ErrCommentPrefix means the comment does not start with type name, etc.
var ErrLongComment = errors.New("long comment")
ErrLongComment means the comment line is beyond line length limit.
var ErrMultiDoc = errors.New("multiple documentation")
ErrMultiDoc means there are multiple package documentations.
var ErrMultiPackage = errors.New("multiple packages")
ErrMultiPackage means there are multiple packages at a single path.
var ErrNoDoc = errors.New("no documentation")
ErrNoDoc represents missing documentation error.
var ErrNotPackage = errors.New("not a package")
ErrNotPackage means that Go failed to parse a path.
Functions ¶
func CheckAST ¶
CheckAST scans top-level exported declarations for presence of documentation. It skips generated data.
func CheckFile ¶
CheckFile verifies that non-generated Go file has documentation attached to the exported declarations. It returns an error if the check fails.
Types ¶
type PathCollector ¶
type PathCollector struct {
// contains filtered or unexported fields
}
PathCollector collects unique folders from a set of files.
func NewPathCollector ¶
func NewPathCollector() *PathCollector
NewPathCollector creates a new PathCollector.
func (*PathCollector) CollectFile ¶
func (pc *PathCollector) CollectFile(name string)
CollectFile collects the path to the file. It skips the path if already in the collector.
func (*PathCollector) Paths ¶
func (pc *PathCollector) Paths() []string
Paths returns a slice of collected paths.