Versions in this module Expand all Collapse all v1 v1.2.0 Mar 7, 2023 Changes in this version + func As(n ast.Node) (T, bool) + func AsBasicLit(n ast.Node) (*ast.BasicLit, bool) + func AsCompositeLit(n ast.Node) (*ast.CompositeLit, bool) + func AsIdent(n ast.Node) (*ast.Ident, bool) + func AsStarExpr(n ast.Node) (*ast.StarExpr, bool) + func AsUnaryExpr(n ast.Node) (*ast.UnaryExpr, bool) + func GetFuncName(fn *ast.FuncDecl) (string, bool) + type CastExpr struct + Expr ast.Expr + func (c *CastExpr) ToBasicLit() (*ast.BasicLit, bool) + func (c *CastExpr) ToCompositeLit() (*ast.CompositeLit, bool) + func (c *CastExpr) ToIdent() (*ast.Ident, bool) + func (c *CastExpr) ToStarExpr() (*ast.StarExpr, bool) + func (c *CastExpr) ToUnaryExpr() (*ast.UnaryExpr, bool) + type FuncInfo struct + Name string + Receivers []*FuncRecv + Returns *FuncReturns + func GetFuncInfo(fn *ast.FuncDecl) *FuncInfo + type FuncRecv struct + Ident *ast.Ident + IsPointer bool + Name string + func GetFuncReceivers(fn *ast.FuncDecl) ([]*FuncRecv, bool) + type FuncReturnCase struct + Results []*CastExpr + func GetFuncReturnCases(fn *ast.FuncDecl) ([]*FuncReturnCase, bool) + type FuncReturnType struct + Ident *ast.Ident + IsPointer bool + func GetFuncReturnTypes(fn *ast.FuncDecl) ([]*FuncReturnType, bool) + type FuncReturns struct + ReturnCases []*FuncReturnCase + Types []*FuncReturnType + type ReturnCaseType int v1.1.2 Mar 6, 2023 Changes in this version + func ParseFile(i *Inspector, p string) error v1.0.1 Feb 21, 2023 Changes in this version + func InspectFile(i *Inspector, p string) error + func InspectNode(i *Inspector, n ast.Node) + func ParseString(i *Inspector, s string) error + type Inspector struct + All listeners[ast.Node] + ArrayType listeners[*ast.ArrayType] + AssignStmt listeners[*ast.AssignStmt] + BadDecl listeners[*ast.BadDecl] + BadExpr listeners[*ast.BadExpr] + BadStmt listeners[*ast.BadStmt] + BasicLit listeners[*ast.BasicLit] + BinaryExpr listeners[*ast.BinaryExpr] + BlockStmt listeners[*ast.BlockStmt] + BranchStmt listeners[*ast.BranchStmt] + CallExpr listeners[*ast.CallExpr] + CaseClause listeners[*ast.CaseClause] + ChanType listeners[*ast.ChanType] + CommClause listeners[*ast.CommClause] + Comment listeners[*ast.Comment] + CommentGroup listeners[*ast.CommentGroup] + CompositeLit listeners[*ast.CompositeLit] + DeclStmt listeners[*ast.DeclStmt] + DeferStmt listeners[*ast.DeferStmt] + Ellipsis listeners[*ast.Ellipsis] + EmptyStmt listeners[*ast.EmptyStmt] + ExprStmt listeners[*ast.ExprStmt] + Field listeners[*ast.Field] + FieldList listeners[*ast.FieldList] + File listeners[*ast.File] + ForStmt listeners[*ast.ForStmt] + FuncDecl listeners[*ast.FuncDecl] + FuncLit listeners[*ast.FuncLit] + FuncType listeners[*ast.FuncType] + GenDecl listeners[*ast.GenDecl] + GoStmt listeners[*ast.GoStmt] + Ident listeners[*ast.Ident] + IfStmt listeners[*ast.IfStmt] + ImportSpec listeners[*ast.ImportSpec] + IncDecStmt listeners[*ast.IncDecStmt] + IndexExpr listeners[*ast.IndexExpr] + IndexListExpr listeners[*ast.IndexListExpr] + InterfaceType listeners[*ast.InterfaceType] + KeyValueExpr listeners[*ast.KeyValueExpr] + LabeledStmt listeners[*ast.LabeledStmt] + MapType listeners[*ast.MapType] + ParenExpr listeners[*ast.ParenExpr] + RangeStmt listeners[*ast.RangeStmt] + ReturnStmt listeners[*ast.ReturnStmt] + SelectStmt listeners[*ast.SelectStmt] + SelectorExpr listeners[*ast.SelectorExpr] + SendStmt listeners[*ast.SendStmt] + SliceExpr listeners[*ast.SliceExpr] + StarExpr listeners[*ast.StarExpr] + StructType listeners[*ast.StructType] + SwitchStmt listeners[*ast.SwitchStmt] + TypeAssertExpr listeners[*ast.TypeAssertExpr] + TypeSpec listeners[*ast.TypeSpec] + TypeSwitchStmt listeners[*ast.TypeSwitchStmt] + UnaryExpr listeners[*ast.UnaryExpr] + ValueSpec listeners[*ast.ValueSpec] + func NewInspector(ops *InspectorOptions) *Inspector + func (i *Inspector) Visit(n ast.Node) ast.Visitor + type InspectorOptions struct + AvoidNil bool + type Listener func(T)