Versions in this module Expand all Collapse all go1 go1.18.10 Jan 10, 2023 Changes in this version + func FileExports(src *File) bool + func FilterDecl(decl Decl, f Filter) bool + func FilterFile(src *File, f Filter) bool + func FilterPackage(pkg *Package, f Filter) bool + func Fprint(w io.Writer, fset *token.FileSet, x any, f FieldFilter) error + func Inspect(node Node, f func(Node) bool) + func IsExported(name string) bool + func NotNilFilter(_ string, v reflect.Value) bool + func PackageExports(pkg *Package) bool + func Print(fset *token.FileSet, x any) error + func SortImports(fset *token.FileSet, f *File) + func Walk(v Visitor, node Node) + type ArrayType struct + Elt Expr + Lbrack token.Pos + Len Expr + func (x *ArrayType) End() token.Pos + func (x *ArrayType) Pos() token.Pos + type AssignStmt struct + Lhs []Expr + Rhs []Expr + Tok token.Token + TokPos token.Pos + func (s *AssignStmt) End() token.Pos + func (s *AssignStmt) Pos() token.Pos + type BadDecl struct + From token.Pos + To token.Pos + func (d *BadDecl) End() token.Pos + func (d *BadDecl) Pos() token.Pos + type BadExpr struct + From token.Pos + To token.Pos + func (x *BadExpr) End() token.Pos + func (x *BadExpr) Pos() token.Pos + type BadStmt struct + From token.Pos + To token.Pos + func (s *BadStmt) End() token.Pos + func (s *BadStmt) Pos() token.Pos + type BasicLit struct + Kind token.Token + Value string + ValuePos token.Pos + func (x *BasicLit) End() token.Pos + func (x *BasicLit) Pos() token.Pos + type BinaryExpr struct + Op token.Token + OpPos token.Pos + X Expr + Y Expr + func (x *BinaryExpr) End() token.Pos + func (x *BinaryExpr) Pos() token.Pos + type BlockStmt struct + Lbrace token.Pos + List []Stmt + Rbrace token.Pos + func (s *BlockStmt) End() token.Pos + func (s *BlockStmt) Pos() token.Pos + type BranchStmt struct + Label *Ident + Tok token.Token + TokPos token.Pos + func (s *BranchStmt) End() token.Pos + func (s *BranchStmt) Pos() token.Pos + type CallExpr struct + Args []Expr + Ellipsis token.Pos + Fun Expr + Lparen token.Pos + Rparen token.Pos + func (x *CallExpr) End() token.Pos + func (x *CallExpr) Pos() token.Pos + type CaseClause struct + Body []Stmt + Case token.Pos + Colon token.Pos + List []Expr + func (s *CaseClause) End() token.Pos + func (s *CaseClause) Pos() token.Pos + type ChanDir int + const RECV + const SEND + type ChanType struct + Arrow token.Pos + Begin token.Pos + Dir ChanDir + Value Expr + func (x *ChanType) End() token.Pos + func (x *ChanType) Pos() token.Pos + type CommClause struct + Body []Stmt + Case token.Pos + Colon token.Pos + Comm Stmt + func (s *CommClause) End() token.Pos + func (s *CommClause) Pos() token.Pos + type Comment struct + Slash token.Pos + Text string + func (c *Comment) End() token.Pos + func (c *Comment) Pos() token.Pos + type CommentGroup struct + List []*Comment + func (g *CommentGroup) End() token.Pos + func (g *CommentGroup) Pos() token.Pos + func (g *CommentGroup) Text() string + type CommentMap map[Node][]*CommentGroup + func NewCommentMap(fset *token.FileSet, node Node, comments []*CommentGroup) CommentMap + func (cmap CommentMap) Comments() []*CommentGroup + func (cmap CommentMap) Filter(node Node) CommentMap + func (cmap CommentMap) String() string + func (cmap CommentMap) Update(old, new Node) Node + type CompositeLit struct + Elts []Expr + Incomplete bool + Lbrace token.Pos + Rbrace token.Pos + Type Expr + func (x *CompositeLit) End() token.Pos + func (x *CompositeLit) Pos() token.Pos + type Decl interface + type DeclStmt struct + Decl Decl + func (s *DeclStmt) End() token.Pos + func (s *DeclStmt) Pos() token.Pos + type DeferStmt struct + Call *CallExpr + Defer token.Pos + func (s *DeferStmt) End() token.Pos + func (s *DeferStmt) Pos() token.Pos + type Ellipsis struct + Ellipsis token.Pos + Elt Expr + func (x *Ellipsis) End() token.Pos + func (x *Ellipsis) Pos() token.Pos + type EmptyStmt struct + Implicit bool + Semicolon token.Pos + func (s *EmptyStmt) End() token.Pos + func (s *EmptyStmt) Pos() token.Pos + type Expr interface + type ExprStmt struct + X Expr + func (s *ExprStmt) End() token.Pos + func (s *ExprStmt) Pos() token.Pos + type Field struct + Comment *CommentGroup + Doc *CommentGroup + Names []*Ident + Tag *BasicLit + Type Expr + func (f *Field) End() token.Pos + func (f *Field) Pos() token.Pos + type FieldFilter func(name string, value reflect.Value) bool + type FieldList struct + Closing token.Pos + List []*Field + Opening token.Pos + func (f *FieldList) End() token.Pos + func (f *FieldList) NumFields() int + func (f *FieldList) Pos() token.Pos + type File struct + Comments []*CommentGroup + Decls []Decl + Doc *CommentGroup + Imports []*ImportSpec + Name *Ident + Package token.Pos + Scope *Scope + Unresolved []*Ident + func MergePackageFiles(pkg *Package, mode MergeMode) *File + func (f *File) End() token.Pos + func (f *File) Pos() token.Pos + type Filter func(string) bool + type ForStmt struct + Body *BlockStmt + Cond Expr + For token.Pos + Init Stmt + Post Stmt + func (s *ForStmt) End() token.Pos + func (s *ForStmt) Pos() token.Pos + type FuncDecl struct + Body *BlockStmt + Doc *CommentGroup + Name *Ident + Recv *FieldList + Type *FuncType + func (d *FuncDecl) End() token.Pos + func (d *FuncDecl) Pos() token.Pos + type FuncLit struct + Body *BlockStmt + Type *FuncType + func (x *FuncLit) End() token.Pos + func (x *FuncLit) Pos() token.Pos + type FuncType struct + Func token.Pos + Params *FieldList + Results *FieldList + TypeParams *FieldList + func (x *FuncType) End() token.Pos + func (x *FuncType) Pos() token.Pos + type GenDecl struct + Doc *CommentGroup + Lparen token.Pos + Rparen token.Pos + Specs []Spec + Tok token.Token + TokPos token.Pos + func (d *GenDecl) End() token.Pos + func (d *GenDecl) Pos() token.Pos + type GoStmt struct + Call *CallExpr + Go token.Pos + func (s *GoStmt) End() token.Pos + func (s *GoStmt) Pos() token.Pos + type Ident struct + Name string + NamePos token.Pos + Obj *Object + func NewIdent(name string) *Ident + func (id *Ident) IsExported() bool + func (id *Ident) String() string + func (x *Ident) End() token.Pos + func (x *Ident) Pos() token.Pos + type IfStmt struct + Body *BlockStmt + Cond Expr + Else Stmt + If token.Pos + Init Stmt + func (s *IfStmt) End() token.Pos + func (s *IfStmt) Pos() token.Pos + type ImportSpec struct + Comment *CommentGroup + Doc *CommentGroup + EndPos token.Pos + Name *Ident + Path *BasicLit + func (s *ImportSpec) End() token.Pos + func (s *ImportSpec) Pos() token.Pos + type Importer func(imports map[string]*Object, path string) (pkg *Object, err error) + type IncDecStmt struct + Tok token.Token + TokPos token.Pos + X Expr + func (s *IncDecStmt) End() token.Pos + func (s *IncDecStmt) Pos() token.Pos + type IndexExpr struct + Index Expr + Lbrack token.Pos + Rbrack token.Pos + X Expr + func (x *IndexExpr) End() token.Pos + func (x *IndexExpr) Pos() token.Pos + type IndexListExpr struct + Indices []Expr + Lbrack token.Pos + Rbrack token.Pos + X Expr + func (x *IndexListExpr) End() token.Pos + func (x *IndexListExpr) Pos() token.Pos + type InterfaceType struct + Incomplete bool + Interface token.Pos + Methods *FieldList + func (x *InterfaceType) End() token.Pos + func (x *InterfaceType) Pos() token.Pos + type KeyValueExpr struct + Colon token.Pos + Key Expr + Value Expr + func (x *KeyValueExpr) End() token.Pos + func (x *KeyValueExpr) Pos() token.Pos + type LabeledStmt struct + Colon token.Pos + Label *Ident + Stmt Stmt + func (s *LabeledStmt) End() token.Pos + func (s *LabeledStmt) Pos() token.Pos + type MapType struct + Key Expr + Map token.Pos + Value Expr + func (x *MapType) End() token.Pos + func (x *MapType) Pos() token.Pos + type MergeMode uint + const FilterFuncDuplicates + const FilterImportDuplicates + const FilterUnassociatedComments + type Node interface + End func() token.Pos + Pos func() token.Pos + type ObjKind int + const Bad + const Con + const Fun + const Lbl + const Pkg + const Typ + const Var + func (kind ObjKind) String() string + type Object struct + Data any + Decl any + Kind ObjKind + Name string + Type any + func NewObj(kind ObjKind, name string) *Object + func (obj *Object) Pos() token.Pos + type Package struct + Files map[string]*File + Imports map[string]*Object + Name string + Scope *Scope + func NewPackage(fset *token.FileSet, files map[string]*File, importer Importer, ...) (*Package, error) + func (p *Package) End() token.Pos + func (p *Package) Pos() token.Pos + type ParenExpr struct + Lparen token.Pos + Rparen token.Pos + X Expr + func (x *ParenExpr) End() token.Pos + func (x *ParenExpr) Pos() token.Pos + type RangeStmt struct + Body *BlockStmt + For token.Pos + Key Expr + Tok token.Token + TokPos token.Pos + Value Expr + X Expr + func (s *RangeStmt) End() token.Pos + func (s *RangeStmt) Pos() token.Pos + type ReturnStmt struct + Results []Expr + Return token.Pos + func (s *ReturnStmt) End() token.Pos + func (s *ReturnStmt) Pos() token.Pos + type Scope struct + Objects map[string]*Object + Outer *Scope + func NewScope(outer *Scope) *Scope + func (s *Scope) Insert(obj *Object) (alt *Object) + func (s *Scope) Lookup(name string) *Object + func (s *Scope) String() string + type SelectStmt struct + Body *BlockStmt + Select token.Pos + func (s *SelectStmt) End() token.Pos + func (s *SelectStmt) Pos() token.Pos + type SelectorExpr struct + Sel *Ident + X Expr + func (x *SelectorExpr) End() token.Pos + func (x *SelectorExpr) Pos() token.Pos + type SendStmt struct + Arrow token.Pos + Chan Expr + Value Expr + func (s *SendStmt) End() token.Pos + func (s *SendStmt) Pos() token.Pos + type SliceExpr struct + High Expr + Lbrack token.Pos + Low Expr + Max Expr + Rbrack token.Pos + Slice3 bool + X Expr + func (x *SliceExpr) End() token.Pos + func (x *SliceExpr) Pos() token.Pos + type Spec interface + type StarExpr struct + Star token.Pos + X Expr + func (x *StarExpr) End() token.Pos + func (x *StarExpr) Pos() token.Pos + type Stmt interface + type StructType struct + Fields *FieldList + Incomplete bool + Struct token.Pos + func (x *StructType) End() token.Pos + func (x *StructType) Pos() token.Pos + type SwitchStmt struct + Body *BlockStmt + Init Stmt + Switch token.Pos + Tag Expr + func (s *SwitchStmt) End() token.Pos + func (s *SwitchStmt) Pos() token.Pos + type TypeAssertExpr struct + Lparen token.Pos + Rparen token.Pos + Type Expr + X Expr + func (x *TypeAssertExpr) End() token.Pos + func (x *TypeAssertExpr) Pos() token.Pos + type TypeSpec struct + Assign token.Pos + Comment *CommentGroup + Doc *CommentGroup + Name *Ident + Type Expr + TypeParams *FieldList + func (s *TypeSpec) End() token.Pos + func (s *TypeSpec) Pos() token.Pos + type TypeSwitchStmt struct + Assign Stmt + Body *BlockStmt + Init Stmt + Switch token.Pos + func (s *TypeSwitchStmt) End() token.Pos + func (s *TypeSwitchStmt) Pos() token.Pos + type UnaryExpr struct + Op token.Token + OpPos token.Pos + X Expr + func (x *UnaryExpr) End() token.Pos + func (x *UnaryExpr) Pos() token.Pos + type ValueSpec struct + Comment *CommentGroup + Doc *CommentGroup + Names []*Ident + Type Expr + Values []Expr + func (s *ValueSpec) End() token.Pos + func (s *ValueSpec) Pos() token.Pos + type Visitor interface + Visit func(node Node) (w Visitor)