eg
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package eg implements the example-based refactoring tool whosecommand-line is defined in golang.org/x/tools/cmd/eg.
Index¶
Constants¶
const Help = ``/* 4316-byte string literal not displayed */
Variables¶
This section is empty.
Functions¶
Types¶
typeTransformer¶
type Transformer struct {// contains filtered or unexported fields}
A Transformer represents a single example-based transformation.
funcNewTransformer¶
func NewTransformer(fset *token.FileSet, tmplPkg *types.Package, tmplFile *ast.File, tmplInfo *types.Info, verbosebool) (*Transformer,error)
NewTransformer returns a transformer based on the specified template,a single-file package containing "before" and "after" functions asdescribed in the package documentation.tmplInfo is the type information for tmplFile.
func (*Transformer)Transform¶
Transform applies the transformation to the specified parsed file,whose type information is supplied in info, and returns the numberof replacements that were made.
It mutates the AST in place (the identity of the root node isunchanged), and may add nodes for which no type information isavailable in info.
Derived from rewriteFile in $GOROOT/src/cmd/gofmt/rewrite.go.