Versions in this module Expand all Collapse all v0 v0.5.1 Jan 24, 2023 Changes in this version + func AddImport(fset *token.FileSet, f *ast.File, path string) (added bool) + func AddNamedImport(fset *token.FileSet, f *ast.File, name, path string) (added bool) + func Apply(root ast.Node, pre, post ApplyFunc) (result ast.Node) + func DeleteImport(fset *token.FileSet, f *ast.File, path string) (deleted bool) + func DeleteNamedImport(fset *token.FileSet, f *ast.File, name, path string) (deleted bool) + func Imports(fset *token.FileSet, f *ast.File) [][]*ast.ImportSpec + func NodeDescription(n ast.Node) string + func PathEnclosingInterval(root *ast.File, start, end token.Pos) (path []ast.Node, exact bool) + func RewriteImport(fset *token.FileSet, f *ast.File, oldPath, newPath string) (rewrote bool) + func Unparen(e ast.Expr) ast.Expr + func UsesImport(f *ast.File, path string) (used bool) + type ApplyFunc func(*Cursor) bool + type Cursor struct + func (c *Cursor) Delete() + func (c *Cursor) Index() int + func (c *Cursor) InsertAfter(n ast.Node) + func (c *Cursor) InsertBefore(n ast.Node) + func (c *Cursor) Name() string + func (c *Cursor) Node() ast.Node + func (c *Cursor) Parent() ast.Node + func (c *Cursor) Replace(n ast.Node)