import "golang.org/x/tools/refactor/eg"
Package eg implements the example-based refactoring tool whose command-line is defined in golang.org/x/tools/cmd/eg.
const Help = "" /* 4318 byte string literal not displayed */
WriteAST is a convenience function that writes AST f to the specified file.
type Transformer struct {
// contains filtered or unexported fields
}
A Transformer represents a single example-based transformation.
func NewTransformer(fset *token.FileSet, tmplPkg *types.Package, tmplFile *ast.File, tmplInfo *types.Info, verbose bool) (*Transformer, error)
NewTransformer returns a transformer based on the specified template, a single-file package containing "before" and "after" functions as described in the package documentation. tmplInfo is the type information for tmplFile.
Transform applies the transformation to the specified parsed file, whose type information is supplied in info, and returns the number of replacements that were made.
It mutates the AST in place (the identity of the root node is unchanged), and may add nodes for which no type information is available in info.
Derived from rewriteFile in $GOROOT/src/cmd/gofmt/rewrite.go.
Package eg imports 15 packages (graph) and is imported by 1 packages. Updated about 13 hours ago. Refresh now. Tools for package owners.