gotools/refactor/rename/spec.go

type spec

// parseFromFlag interprets the "-from" flag value as a renaming specification.
// See Usage in rename.go for valid formats.
func parseFromFlag(ctxt *build.Context, fromFlag string) (*spec, error) {}

// parseObjectSpec parses main as one of the non-filename forms of
// object specification.
func parseObjectSpec(spec *spec, main string) error {}

// parseImportPath returns the import path of the package denoted by e.
// Any import path may be represented as a string literal;
// single-segment import paths (e.g. "bytes") may also be represented as
// ast.Ident.  parseImportPath returns "" for all other expressions.
func parseImportPath(e ast.Expr) string {}

// parseOffsetFlag interprets the "-offset" flag value as a renaming specification.
func parseOffsetFlag(ctxt *build.Context, offsetFlag string) (*spec, error) {}

var wd

func findFromObjects(iprog *loader.Program, spec *spec) ([]types.Object, error) {}

func findFromObjectsInFile(iprog *loader.Program, spec *spec) ([]types.Object, error) {}

func typeSwitchVar(info *types.Info, path []ast.Node) types.Object {}

// On success, findObjects returns the list of objects named
// spec.fromName matching the spec.  On success, the result has exactly
// one element unless spec.searchFor!="", in which case it has at least one
// element.
func findObjects(info *loader.PackageInfo, spec *spec) ([]types.Object, error) {}

func funcDecl(info *loader.PackageInfo, fn *types.Func) *ast.FuncDecl {}

func searchDefs(info *types.Info, name string) []types.Object {}

func identAtOffset(fset *token.FileSet, f *ast.File, offset int) *ast.Ident {}

// ambiguityError returns an error describing an ambiguous "*" scope query.
func ambiguityError(fset *token.FileSet, objects []types.Object) error {}

var generatedRx

// generated reports whether ast.File is a generated file.
func generated(f *ast.File, tokenFile *token.File) bool {}