Movatterモバイル変換


[0]ホーム

URL:


eg

package
v0.37.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2025 License:BSD-3-ClauseImports:17Imported by:79

Details

Repository

cs.opensource.google/go/x/tools

Links

Documentation

Overview

Package eg implements the example-based refactoring tool whosecommand-line is defined in golang.org/x/tools/cmd/eg.

Index

Constants

View Source
const Help = ``/* 4316-byte string literal not displayed */

Variables

This section is empty.

Functions

funcWriteAST

func WriteAST(fset *token.FileSet, filenamestring, f *ast.File) (errerror)

WriteAST is a convenience function that writes AST f to the specified file.

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

func (tr *Transformer) Transform(info *types.Info, pkg *types.Package, file *ast.File)int

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.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp