rename

package
v0.0.0-...-a87e08b Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2015 License: BSD-3-Clause Imports: 30 Imported by: 0

Documentation

Overview

Package rename contains the implementation of the 'gorename' command whose main function is in golang.org/x/tools/cmd/gorename. See the Usage constant for the command documentation.

Index

Constants

View Source
const Usage = `` /* 4050-byte string literal not displayed */

Variables

View Source
var (
	// Force enables patching of the source files even if conflicts were reported.
	// The resulting program may be ill-formed.
	// It may even cause gorename to crash.  TODO(adonovan): fix that.
	Force bool

	// DryRun causes the tool to report conflicts but not update any files.
	DryRun bool

	// ConflictError is returned by Main when it aborts the renaming due to conflicts.
	// (It is distinguished because the interesting errors are the conflicts themselves.)
	ConflictError = errors.New("renaming aborted due to conflicts")

	// Verbose enables extra logging.
	Verbose bool
)

Functions

func Main

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

func Move

func Move(ctxt *build.Context, from, to, moveTmpl string) error

Move, given a package path and a destination package path, will try to move the given package to the new path. The Move function will first check for any conflicts preventing the move, such as a package already existing at the destination package path. If the move can proceed, it builds an import graph to find all imports of the packages whose paths need to be renamed. This includes uses of the subpackages of the package to be moved as those packages will also need to be moved. It then renames all imports to point to the new paths, and then moves the packages to their new paths.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL