Documentation ¶
Overview ¶
Package astutil constains some small utilities for working with Go syntax trees.
Index ¶
- func Calls(fset *token.FileSet, f *ast.File, fn string) ([]*ast.CallExpr, error)
- func Ident(node ast.Expr) string
- func Importer(imports map[string]*ast.Object, path string) (*ast.Object, error)
- func Imports(f *ast.File, pkg string) (string, bool)
- func New(p *build.Package, mode parser.Mode) (*token.FileSet, *ast.Package, error)
- func ObjectName(obj *ast.Object) (pkg string, typ string)
- func ParseFiles(fset *token.FileSet, abspath string, names []string, mode parser.Mode) (map[string]*ast.File, error)
- func Selector(expr ast.Expr) (x string, sel string)
- func StringLiteral(f *token.FileSet, n ast.Expr) (string, *token.Position)
- type String
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Calls ¶
Calls returns the calls to a given function or method specified as a qualified name (e.g. gnd.la/i18n.T or gnd.la/app.Context.T).
func Imports ¶
Imports return whetever the given ast.File imports the package named pkg. It also returns its local imported name.
func ObjectName ¶
ObjectName returns the object package and type name for the given ast.Object.
func ParseFiles ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.