Standard Library

GoParser

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

Other Methods

.ParseDir()Neutral
#
Signature
ParseDir(fset *token.FileSet, path string, filter func(fs.FileInfo) bool, mode Mode) (map[string]*ast.Package, error)

ParseDir calls ParseFile for all files with names ending in ".go" in the

.ParseExpr()Neutral
#
Signature
ParseExpr(x string) (ast.Expr, error)

ParseExpr is a convenience function for obtaining the AST of an expression x.

.ParseExprFrom()Neutral
#
Signature
ParseExprFrom(fset *token.FileSet, filename string, src any, mode Mode) (ast.Expr, error)

ParseExprFrom is a convenience function for parsing an expression.

.ParseFile()Neutral
#
Signature
ParseFile(fset *token.FileSet, filename string, src any, mode Mode) (*ast.File, error)

ParseFile parses the source code of a single Go source file and returns

.Mode()Neutral
#
Signature
type Mode ...

A Mode value is a set of flags (or 0).

Fully-Qualified Names

FQNField
go/parserfqns[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/parser