gotools/refactor/rename/rename.go

const Usage

var Force

var Diff

var DiffCmd

var ConflictError

var Verbose

var stdout

type renamer

var reportError

// importName renames imports of fromPath within the package specified by info.
// If fromName is not empty, importName renames only imports as fromName.
// If the renaming would lead to a conflict, the file is left unchanged.
func importName(iprog *loader.Program, info *loader.PackageInfo, fromPath, fromName, to string) error {}

func Main(ctxt *build.Context, offsetFlag, fromFlag, to string) error {}

// loadProgram loads the specified set of packages (plus their tests)
// and all their dependencies, from source, through the specified build
// context.  Only packages in pkgs will have their functions bodies typechecked.
func loadProgram(ctxt *build.Context, pkgs map[string]bool) (*loader.Program, error) {}

func containsHardErrors(errors []error) bool {}

// requiresGlobalRename reports whether this renaming could potentially
// affect other packages in the Go workspace.
func requiresGlobalRename(fromObjects []types.Object, to string) bool {}

// update updates the input files.
func (r *renamer) update() error {}

// docComment returns the doc for an identifier.
func (r *renamer) docComment(id *ast.Ident) *ast.CommentGroup {}

func plural(n int) string {}

var writeFile

func reallyWriteFile(filename string, content []byte) error {}

func diff(filename string, content []byte) error {}