# Functions
FileExports trims the AST for a Go source file in place such that only exported nodes remain: all top-level identifiers which are not exported and their associated information (such as type, initial value, or function body) are removed.
FilterDecl trims the AST for a Go declaration in place by removing all names (including struct field and interface method names, but not from parameter lists) that don't pass through the filter f.
FilterFile trims the AST for a Go file in place by removing all names from top-level declarations (including struct field and interface method names, but not from parameter lists) that don't pass through the filter f.
FilterPackage trims the AST for a Go package in place by removing all names from top-level declarations (including struct field and interface method names, but not from parameter lists) that don't pass through the filter f.
Fprint prints the (sub-)tree starting at AST node x to w.
Inspect traverses an AST in depth-first order: It starts by calling f(node); node must not be nil.
IsExported reports whether name is an exported Go symbol (that is, whether it begins with an upper-case letter).
MergePackageFiles creates a file AST by merging the ASTs of the files belonging to a package.
NewCommentMap creates a new comment map by associating comment groups of the comments list with the nodes of the AST specified by node.
NewIdent creates a new Ident without position.
NewObj creates a new object of a given kind and name.
NewPackage creates a new Package node from a set of File nodes.
NewScope creates a new scope nested in the outer scope.
NotNilFilter returns true for field values that are not nil; it returns false otherwise.
PackageExports trims the AST for a Go package in place such that only exported nodes remain.
Print prints x to standard output, skipping nil fields.
SortImports sorts runs of consecutive import lines in import blocks in f.
Walk traverses an AST in depth-first order: It starts by calling v.Visit(node); node must not be nil.
# Constants
for error handling.
constant.
If set, duplicate function declarations are excluded.
If set, duplicate import declarations are excluded.
If set, comments that are not associated with a specific AST node (as Doc or Comment) are excluded.
function or method.
label.
package.
No description provided by the author
No description provided by the author
type.
variable.
# Structs
A type is represented by a tree consisting of one or more of the following type-specific expression nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
A declaration is represented by one of the following declaration nodes.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
A type is represented by a tree consisting of one or more of the following type-specific expression nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
A Comment node represents a single //-style or /*-style comment.
A CommentGroup represents a sequence of comments with no other tokens and no empty lines between.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
A Field represents a Field declaration list in a struct type, a method list in an interface type, or a parameter/result declaration in a signature.
A FieldList represents a list of Fields, enclosed by parentheses or braces.
A File node represents a Go source file.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
A declaration is represented by one of the following declaration nodes.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
A type is represented by a tree consisting of one or more of the following type-specific expression nodes.
A declaration is represented by one of the following declaration nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
A Spec node represents a single (non-parenthesized) import, constant, type, or variable declaration.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
A type is represented by a tree consisting of one or more of the following type-specific expression nodes.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
A type is represented by a tree consisting of one or more of the following type-specific expression nodes.
An Object describes a named language entity such as a package, constant, type, variable, function (incl.
A Package node represents a set of source files collectively building a Go package.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
A Scope maintains the set of named language entities declared in the scope and a link to the immediately surrounding (outer) scope.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
A type is represented by a tree consisting of one or more of the following type-specific expression nodes.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
A Spec node represents a single (non-parenthesized) import, constant, type, or variable declaration.
A statement is represented by a tree consisting of one or more of the following concrete statement nodes.
An expression is represented by a tree consisting of one or more of the following concrete expression nodes.
A Spec node represents a single (non-parenthesized) import, constant, type, or variable declaration.
# Interfaces
All declaration nodes implement the Decl interface.
All expression nodes implement the Expr interface.
All node types implement the Node interface.
A Spec node represents a single (non-parenthesized) import, constant, type, or variable declaration.
All statement nodes implement the Stmt interface.
A Visitor's Visit method is invoked for each node encountered by Walk.
# Type aliases
The direction of a channel type is indicated by one of the following constants.
A CommentMap maps an AST node to a list of comment groups associated with it.
A FieldFilter may be provided to Fprint to control the output.
No description provided by the author
An Importer resolves import paths to package Objects.
The MergeMode flags control the behavior of MergePackageFiles.
ObjKind describes what an object represents.