ast

package
v0.0.0-...-b84665b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package ast declares the types used to represent syntax trees for Go packages.

Index

Constants

View Source
const Bad = ast.Bad
View Source
const Con = ast.Con
View Source
const FilterFuncDuplicates = ast.FilterFuncDuplicates

If set, duplicate function declarations are excluded.

View Source
const FilterImportDuplicates = ast.FilterImportDuplicates

If set, duplicate import declarations are excluded.

View Source
const FilterUnassociatedComments = ast.FilterUnassociatedComments

If set, comments that are not associated with a specific AST node (as Doc or Comment) are excluded.

View Source
const Fun = ast.Fun
View Source
const Lbl = ast.Lbl
View Source
const Pkg = ast.Pkg
View Source
const RECV = ast.RECV
View Source
const SEND = ast.SEND
View Source
const Typ = ast.Typ
View Source
const Var = ast.Var

Variables

This section is empty.

Functions

func FileExports

func FileExports(src *File) bool

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. Non-exported fields and methods of exported types are stripped. The [File.Comments] list is not changed.

FileExports reports whether there are exported declarations. This is an alias of https://pkg.go.dev/go/ast#FileExports.

func FilterDecl

func FilterDecl(decl Decl, f Filter) bool

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.

FilterDecl reports whether there are any declared names left after filtering. This is an alias of https://pkg.go.dev/go/ast#FilterDecl.

func FilterFile

func FilterFile(src *File, f Filter) bool

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. If the declaration is empty afterwards, the declaration is removed from the AST. Import declarations are always removed. The [File.Comments] list is not changed.

FilterFile reports whether there are any top-level declarations left after filtering. This is an alias of https://pkg.go.dev/go/ast#FilterFile.

func FilterPackage

func FilterPackage(pkg *Package, f Filter) bool

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. If the declaration is empty afterwards, the declaration is removed from the AST. The pkg.Files list is not changed, so that file names and top-level package comments don't get lost.

FilterPackage reports whether there are any top-level declarations left after filtering. This is an alias of https://pkg.go.dev/go/ast#FilterPackage.

func Fprint

func Fprint(w io.Writer, fset *token.FileSet, x any, f FieldFilter) error

Fprint prints the (sub-)tree starting at AST node x to w. If fset != nil, position information is interpreted relative to that file set. Otherwise positions are printed as integer values (file set specific offsets).

A non-nil FieldFilter f may be provided to control the output: struct fields for which f(fieldname, fieldvalue) is true are printed; all others are filtered from the output. Unexported struct fields are never printed. This is an alias of https://pkg.go.dev/go/ast#Fprint.

func Inspect

func Inspect(node Node, f func(Node) bool)

Inspect traverses an AST in depth-first order: It starts by calling f(node); node must not be nil. If f returns true, Inspect invokes f recursively for each of the non-nil children of node, followed by a call of f(nil). This is an alias of https://pkg.go.dev/go/ast#Inspect.

func IsExported

func IsExported(name string) bool

IsExported reports whether name starts with an upper-case letter. This is an alias of https://pkg.go.dev/go/ast#IsExported.

func IsGenerated

func IsGenerated(file *File) bool

IsGenerated reports whether the file was generated by a program, not handwritten, by detecting the special comment described at https://go.dev/s/generatedcode.

The syntax tree must have been parsed with the [parser.ParseComments] flag. Example:

f, err := parser.ParseFile(fset, filename, src, parser.ParseComments|parser.PackageClauseOnly)
if err != nil { ... }
gen := ast.IsGenerated(f)

This is an alias of https://pkg.go.dev/go/ast#IsGenerated.

func NotNilFilter

func NotNilFilter(_ string, v reflect.Value) bool

NotNilFilter is a FieldFilter that returns true for field values that are not nil; it returns false otherwise. This is an alias of https://pkg.go.dev/go/ast#NotNilFilter.

func PackageExports

func PackageExports(pkg *Package) bool

PackageExports trims the AST for a Go package in place such that only exported nodes remain. The pkg.Files list is not changed, so that file names and top-level package comments don't get lost.

PackageExports reports whether there are exported declarations; it returns false otherwise. This is an alias of https://pkg.go.dev/go/ast#PackageExports.

func Preorder

func Preorder(root Node) iter.Seq[Node]

Preorder returns an iterator over all the nodes of the syntax tree beneath (and including) the specified root, in depth-first preorder.

For greater control over the traversal of each subtree, use Inspect. This is an alias of https://pkg.go.dev/go/ast#Preorder.

func Print

func Print(fset *token.FileSet, x any) error

Print prints x to standard output, skipping nil fields. Print(fset, x) is the same as Fprint(os.Stdout, fset, x, NotNilFilter). This is an alias of https://pkg.go.dev/go/ast#Print.

func SortImports

func SortImports(fset *token.FileSet, f *File)

SortImports sorts runs of consecutive import lines in import blocks in f. It also removes duplicate imports when it is possible to do so without data loss. This is an alias of https://pkg.go.dev/go/ast#SortImports.

func Walk

func Walk(v Visitor, node Node)

Walk traverses an AST in depth-first order: It starts by calling v.Visit(node); node must not be nil. If the visitor w returned by v.Visit(node) is not nil, Walk is invoked recursively with visitor w for each of the non-nil children of node, followed by a call of w.Visit(nil). This is an alias of https://pkg.go.dev/go/ast#Walk.

Types

type ArrayType

type ArrayType = ast.ArrayType

A type is represented by a tree consisting of one or more of the following type-specific expression nodes.

This is an alias of https://pkg.go.dev/go/ast#ArrayType.

type AssignStmt

type AssignStmt = ast.AssignStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#AssignStmt.

type BadDecl

type BadDecl = ast.BadDecl

A declaration is represented by one of the following declaration nodes.

This is an alias of https://pkg.go.dev/go/ast#BadDecl.

type BadExpr

type BadExpr = ast.BadExpr

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#BadExpr.

type BadStmt

type BadStmt = ast.BadStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#BadStmt.

type BasicLit

type BasicLit = ast.BasicLit

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#BasicLit.

type BinaryExpr

type BinaryExpr = ast.BinaryExpr

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#BinaryExpr.

type BlockStmt

type BlockStmt = ast.BlockStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#BlockStmt.

type BranchStmt

type BranchStmt = ast.BranchStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#BranchStmt.

type CallExpr

type CallExpr = ast.CallExpr

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#CallExpr.

type CaseClause

type CaseClause = ast.CaseClause

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#CaseClause.

type ChanDir

type ChanDir = ast.ChanDir

The direction of a channel type is indicated by a bit mask including one or both of the following constants.

This is an alias of https://pkg.go.dev/go/ast#ChanDir.

type ChanType

type ChanType = ast.ChanType

A type is represented by a tree consisting of one or more of the following type-specific expression nodes.

This is an alias of https://pkg.go.dev/go/ast#ChanType.

type CommClause

type CommClause = ast.CommClause

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#CommClause.

type Comment

type Comment = ast.Comment

A Comment node represents a single //-style or /*-style comment.

The Text field contains the comment text without carriage returns (\r) that may have been present in the source. Because a comment's end position is computed using len(Text), the position reported by [Comment.End] does not match the true source end position for comments containing carriage returns.

This is an alias of https://pkg.go.dev/go/ast#Comment.

type CommentGroup

type CommentGroup = ast.CommentGroup

A CommentGroup represents a sequence of comments with no other tokens and no empty lines between.

This is an alias of https://pkg.go.dev/go/ast#CommentGroup.

type CommentMap

type CommentMap = ast.CommentMap

A CommentMap maps an AST node to a list of comment groups associated with it. See NewCommentMap for a description of the association.

This is an alias of https://pkg.go.dev/go/ast#CommentMap.

func NewCommentMap

func NewCommentMap(fset *token.FileSet, node Node, comments []*CommentGroup) CommentMap

NewCommentMap creates a new comment map by associating comment groups of the comments list with the nodes of the AST specified by node.

A comment group g is associated with a node n if:

  • g starts on the same line as n ends
  • g starts on the line immediately following n, and there is at least one empty line after g and before the next node
  • g starts before n and is not associated to the node before n via the previous rules

NewCommentMap tries to associate a comment group to the "largest" node possible: For instance, if the comment is a line comment trailing an assignment, the comment is associated with the entire assignment rather than just the last operand in the assignment. This is an alias of https://pkg.go.dev/go/ast#NewCommentMap.

type CompositeLit

type CompositeLit = ast.CompositeLit

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#CompositeLit.

type Decl

type Decl = ast.Decl

All declaration nodes implement the Decl interface.

This is an alias of https://pkg.go.dev/go/ast#Decl.

type DeclStmt

type DeclStmt = ast.DeclStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#DeclStmt.

type DeferStmt

type DeferStmt = ast.DeferStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#DeferStmt.

type Ellipsis

type Ellipsis = ast.Ellipsis

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#Ellipsis.

type EmptyStmt

type EmptyStmt = ast.EmptyStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#EmptyStmt.

type Expr

type Expr = ast.Expr

All expression nodes implement the Expr interface.

This is an alias of https://pkg.go.dev/go/ast#Expr.

func Unparen

func Unparen(e Expr) Expr

Unparen returns the expression with any enclosing parentheses removed. This is an alias of https://pkg.go.dev/go/ast#Unparen.

type ExprStmt

type ExprStmt = ast.ExprStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#ExprStmt.

type Field

type Field = ast.Field

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. [Field.Names] is nil for unnamed parameters (parameter lists which only contain types) and embedded struct fields. In the latter case, the field name is the type name.

This is an alias of https://pkg.go.dev/go/ast#Field.

type FieldFilter

type FieldFilter = ast.FieldFilter

A FieldFilter may be provided to Fprint to control the output.

This is an alias of https://pkg.go.dev/go/ast#FieldFilter.

type FieldList

type FieldList = ast.FieldList

A FieldList represents a list of Fields, enclosed by parentheses, curly braces, or square brackets.

This is an alias of https://pkg.go.dev/go/ast#FieldList.

type File

type File = ast.File

A File node represents a Go source file.

The Comments list contains all comments in the source file in order of appearance, including the comments that are pointed to from other nodes via Doc and Comment fields.

For correct printing of source code containing comments (using packages go/format and go/printer), special care must be taken to update comments when a File's syntax tree is modified: For printing, comments are interspersed between tokens based on their position. If syntax tree nodes are removed or moved, relevant comments in their vicinity must also be removed (from the [File.Comments] list) or moved accordingly (by updating their positions). A CommentMap may be used to facilitate some of these operations.

Whether and how a comment is associated with a node depends on the interpretation of the syntax tree by the manipulating program: except for Doc and Comment comments directly associated with nodes, the remaining comments are "free-floating" (see also issues #18593, #20744).

This is an alias of https://pkg.go.dev/go/ast#File.

func MergePackageFiles

func MergePackageFiles(pkg *Package, mode MergeMode) *File

MergePackageFiles creates a file AST by merging the ASTs of the files belonging to a package. The mode flags control merging behavior. This is an alias of https://pkg.go.dev/go/ast#MergePackageFiles.

type Filter

type Filter = ast.Filter

This is an alias of https://pkg.go.dev/go/ast#Filter.

type ForStmt

type ForStmt = ast.ForStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#ForStmt.

type FuncDecl

type FuncDecl = ast.FuncDecl

A declaration is represented by one of the following declaration nodes.

This is an alias of https://pkg.go.dev/go/ast#FuncDecl.

type FuncLit

type FuncLit = ast.FuncLit

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#FuncLit.

type FuncType

type FuncType = ast.FuncType

A type is represented by a tree consisting of one or more of the following type-specific expression nodes.

This is an alias of https://pkg.go.dev/go/ast#FuncType.

type GenDecl

type GenDecl = ast.GenDecl

A declaration is represented by one of the following declaration nodes.

This is an alias of https://pkg.go.dev/go/ast#GenDecl.

type GoStmt

type GoStmt = ast.GoStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#GoStmt.

type Ident

type Ident = ast.Ident

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#Ident.

func NewIdent

func NewIdent(name string) *Ident

NewIdent creates a new Ident without position. Useful for ASTs generated by code other than the Go parser. This is an alias of https://pkg.go.dev/go/ast#NewIdent.

type IfStmt

type IfStmt = ast.IfStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#IfStmt.

type ImportSpec

type ImportSpec = ast.ImportSpec

A Spec node represents a single (non-parenthesized) import, constant, type, or variable declaration.

This is an alias of https://pkg.go.dev/go/ast#ImportSpec.

type Importer deprecated

type Importer = ast.Importer

An Importer resolves import paths to package Objects. The imports map records the packages already imported, indexed by package id (canonical import path). An Importer must determine the canonical import path and check the map to see if it is already present in the imports map. If so, the Importer can return the map entry. Otherwise, the Importer should load the package data for the given path into a new *Object (pkg), record pkg in the imports map, and then return pkg.

Deprecated: use the type checker go/types instead; see Object.

This is an alias of https://pkg.go.dev/go/ast#Importer.

type IncDecStmt

type IncDecStmt = ast.IncDecStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#IncDecStmt.

type IndexExpr

type IndexExpr = ast.IndexExpr

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#IndexExpr.

type IndexListExpr

type IndexListExpr = ast.IndexListExpr

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#IndexListExpr.

type InterfaceType

type InterfaceType = ast.InterfaceType

A type is represented by a tree consisting of one or more of the following type-specific expression nodes.

This is an alias of https://pkg.go.dev/go/ast#InterfaceType.

type KeyValueExpr

type KeyValueExpr = ast.KeyValueExpr

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#KeyValueExpr.

type LabeledStmt

type LabeledStmt = ast.LabeledStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#LabeledStmt.

type MapType

type MapType = ast.MapType

A type is represented by a tree consisting of one or more of the following type-specific expression nodes.

This is an alias of https://pkg.go.dev/go/ast#MapType.

type MergeMode

type MergeMode = ast.MergeMode

The MergeMode flags control the behavior of MergePackageFiles.

This is an alias of https://pkg.go.dev/go/ast#MergeMode.

type Node

type Node = ast.Node

All node types implement the Node interface.

This is an alias of https://pkg.go.dev/go/ast#Node.

type ObjKind

type ObjKind = ast.ObjKind

ObjKind describes what an Object represents.

This is an alias of https://pkg.go.dev/go/ast#ObjKind.

type Object deprecated

type Object = ast.Object

An Object describes a named language entity such as a package, constant, type, variable, function (incl. methods), or label.

The Data fields contains object-specific data:

Kind    Data type         Data value
Pkg     *Scope            package scope
Con     int               iota for the respective declaration

Deprecated: The relationship between Idents and Objects cannot be correctly computed without type information. For example, the expression T{K: 0} may denote a struct, map, slice, or array literal, depending on the type of T. If T is a struct, then K refers to a field of T, whereas for the other types it refers to a value in the environment.

New programs should set the [parser.SkipObjectResolution] parser flag to disable syntactic object resolution (which also saves CPU and memory), and instead use the type checker go/types if object resolution is desired. See the Defs, Uses, and Implicits fields of the [types.Info] struct for details.

This is an alias of https://pkg.go.dev/go/ast#Object.

func NewObj

func NewObj(kind ObjKind, name string) *Object

NewObj creates a new object of a given kind and name. This is an alias of https://pkg.go.dev/go/ast#NewObj.

type Package deprecated

type Package = ast.Package

A Package node represents a set of source files collectively building a Go package.

Deprecated: use the type checker go/types instead; see Object.

This is an alias of https://pkg.go.dev/go/ast#Package.

func NewPackage deprecated

func NewPackage(fset *token.FileSet, files map[string]*File, importer Importer, universe *Scope) (*Package, error)

NewPackage creates a new Package node from a set of File nodes. It resolves unresolved identifiers across files and updates each file's Unresolved list accordingly. If a non-nil importer and universe scope are provided, they are used to resolve identifiers not declared in any of the package files. Any remaining unresolved identifiers are reported as undeclared. If the files belong to different packages, one package name is selected and files with different package names are reported and then ignored. The result is a package node and a [scanner.ErrorList] if there were errors.

Deprecated: use the type checker go/types instead; see Object. This is an alias of https://pkg.go.dev/go/ast#NewPackage.

type ParenExpr

type ParenExpr = ast.ParenExpr

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#ParenExpr.

type Printer

type Printer struct {
	Imports set.Set[string]
}

func (*Printer) Print

func (p *Printer) Print(node ast.Node) string

func (*Printer) PrintExpr

func (p *Printer) PrintExpr(x ast.Expr) string

func (*Printer) PrintFieldList

func (p *Printer) PrintFieldList(fields *ast.FieldList) []string

func (*Printer) Visit

func (p *Printer) Visit(node ast.Node)

func (*Printer) VisitDecl

func (p *Printer) VisitDecl(decl ast.Decl)

func (*Printer) VisitExpr

func (p *Printer) VisitExpr(expr ast.Expr)

type RangeStmt

type RangeStmt = ast.RangeStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#RangeStmt.

type ReturnStmt

type ReturnStmt = ast.ReturnStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#ReturnStmt.

type Scope deprecated

type Scope = ast.Scope

A Scope maintains the set of named language entities declared in the scope and a link to the immediately surrounding (outer) scope.

Deprecated: use the type checker go/types instead; see Object.

This is an alias of https://pkg.go.dev/go/ast#Scope.

func NewScope

func NewScope(outer *Scope) *Scope

NewScope creates a new scope nested in the outer scope. This is an alias of https://pkg.go.dev/go/ast#NewScope.

type SelectStmt

type SelectStmt = ast.SelectStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#SelectStmt.

type SelectorExpr

type SelectorExpr = ast.SelectorExpr

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#SelectorExpr.

type SendStmt

type SendStmt = ast.SendStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#SendStmt.

type SliceExpr

type SliceExpr = ast.SliceExpr

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#SliceExpr.

type Spec

type Spec = ast.Spec

A Spec node represents a single (non-parenthesized) import, constant, type, or variable declaration.

This is an alias of https://pkg.go.dev/go/ast#Spec.

type StarExpr

type StarExpr = ast.StarExpr

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#StarExpr.

type Stmt

type Stmt = ast.Stmt

All statement nodes implement the Stmt interface.

This is an alias of https://pkg.go.dev/go/ast#Stmt.

type StructType

type StructType = ast.StructType

A type is represented by a tree consisting of one or more of the following type-specific expression nodes.

This is an alias of https://pkg.go.dev/go/ast#StructType.

type SwitchStmt

type SwitchStmt = ast.SwitchStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#SwitchStmt.

type TypeAssertExpr

type TypeAssertExpr = ast.TypeAssertExpr

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#TypeAssertExpr.

type TypeSpec

type TypeSpec = ast.TypeSpec

A Spec node represents a single (non-parenthesized) import, constant, type, or variable declaration.

This is an alias of https://pkg.go.dev/go/ast#TypeSpec.

type TypeSwitchStmt

type TypeSwitchStmt = ast.TypeSwitchStmt

A statement is represented by a tree consisting of one or more of the following concrete statement nodes.

This is an alias of https://pkg.go.dev/go/ast#TypeSwitchStmt.

type UnaryExpr

type UnaryExpr = ast.UnaryExpr

An expression is represented by a tree consisting of one or more of the following concrete expression nodes.

This is an alias of https://pkg.go.dev/go/ast#UnaryExpr.

type ValueSpec

type ValueSpec = ast.ValueSpec

A Spec node represents a single (non-parenthesized) import, constant, type, or variable declaration.

This is an alias of https://pkg.go.dev/go/ast#ValueSpec.

type Visitor

type Visitor = ast.Visitor

A Visitor's Visit method is invoked for each node encountered by Walk. If the result visitor w is not nil, Walk visits each of the children of node with the visitor w, followed by a call of w.Visit(nil).

This is an alias of https://pkg.go.dev/go/ast#Visitor.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL