Help us shape the future of Go! Take the 2026 Go Developer Survey

refactor

package
v0.0.0-...-c40c2f6 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: Unlicense Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetermineExtractionTarget

func DetermineExtractionTarget(sourceFilePath string, funcDecl *ast.FuncDecl) (
	targetFilePath string,
	targetFuncName string,
	targetPackageName string,
)

DetermineExtractionTarget determines where we'd like to extract the function to.

func MoveBatchFiles

func MoveBatchFiles(moveOps []MoveOp, moduleRoot string, goimportsPath string) error

MoveBatchFiles performs atomic batch file moves with refactoring support. All files are moved together and import updates happen once for all files.

func MoveFileWithImportUpdates

func MoveFileWithImportUpdates(sourceFile string, targetFile string, moduleRoot string, goimportsPath string) error

MoveFileWithImportUpdates performs a refactoring file move from source to target, updating all import statements in the codebase that reference the old package path.

Types

type MoveOp

type MoveOp struct {
	From string // Absolute source path
	To   string // Absolute destination path
}

MoveOp represents a single file move operation

type UnexportedDependency

type UnexportedDependency struct {
	Name         string // Symbol name
	Kind         string // "func", "var", "type", "const", "method"
	DefiningFile string // File where symbol is defined
}

UnexportedDependency represents an unexported symbol that a file depends on.

type UnexportedRef

type UnexportedRef struct {
	SymbolName     string
	FileName       string   // File containing the symbol
	ReferencedFrom []string // Files referencing it
}

UnexportedRef represents an unexported symbol being referenced from another package

Jump to

Keyboard shortcuts

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