Documentation
¶
Overview ¶
Package run implements the main logic for the impgen tool in a testable way.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrFunctionModeRequired indicates that a mode flag is required for functions. ErrFunctionModeRequired = errors.New("mode flag required: use --target or --dependency") // ErrInterfaceModeRequired indicates that a mode flag is required for interfaces. ErrInterfaceModeRequired = errors.New("mode flag required: use --dependency or --target") )
Exported variables.
Functions ¶
func Run ¶
func Run( args []string, getEnv func(string) string, fileSystem FileSystem, pkgLoader detect.PackageLoader, out io.Writer, ) error
Run executes the impgen tool logic. It takes command-line arguments, an environment variable getter, an output.Writer interface for file operations, a PackageLoader for package operations, and an io.Writer for output messages. It returns an error if any step fails. On success, it generates a Go source file implementing the specified interface, in the calling test package.
Types ¶
type FileReader ¶
type FileSystem ¶
type FileSystem interface {
FileReader
output.Writer
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package astutil provides shared utilities for AST manipulation and string formatting.
|
Package astutil provides shared utilities for AST manipulation and string formatting. |
|
Package cache provides caching for generated code signatures to support incremental regeneration in the impgen tool.
|
Package cache provides caching for generated code signatures to support incremental regeneration in the impgen tool. |
|
Package load provides package loading functionality using DST parsing.
|
Package load provides package loading functionality using DST parsing. |
|
Package detect provides symbol detection and type resolution for Go packages.
|
Package detect provides symbol detection and type resolution for Go packages. |
Click to show internal directories.
Click to hide internal directories.