Standard Library

GoDoc

Go stdlib package — go/doc. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

Other Methods

.Examples()Neutral
#
Signature
Examples(testFiles *ast.File) []*Example

Examples returns the examples found in testFiles, sorted by Name field.

.IsPredeclared()Neutral
#
Signature
IsPredeclared(s string) bool

IsPredeclared reports whether s is a predeclared identifier.

.New()Neutral
#
Signature
New(pkg *ast.Package, importPath string, mode Mode) *Package

New computes the package documentation for the given package AST.

.NewFromFiles()Neutral
#
Signature
NewFromFiles(fset *token.FileSet, files []*ast.File, importPath string, opts any) (*Package, error)

NewFromFiles computes documentation for a package.

.Package.Filter()Neutral
#
Signature
Package.Filter(f Filter)

Filter eliminates documentation for names that don't pass through the filter f.

.Package.HTML()Neutral
#
Signature
Package.HTML(text string) []byte

HTML returns formatted HTML for the doc comment text.

.Package.Markdown()Neutral
#
Signature
Package.Markdown(text string) []byte

Markdown returns formatted Markdown for the doc comment text.

.Package.Parser()Neutral
#
Signature
Package.Parser() *comment.Parser

Parser returns a doc comment parser configured

.Package.Printer()Neutral
#
Signature
Package.Printer() *comment.Printer

Printer returns a doc comment printer configured

.Package.Synopsis()Neutral
#
Signature
Package.Synopsis(text string) string

Synopsis returns a cleaned version of the first sentence in text.

Fully-Qualified Names

FQNField
go/docfqns[0]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

go.mod
// standard library — no go.mod entry required
rule.py
from codepathfinder.go_rule import ...  # go/doc