run

package
v0.0.0-...-3621051 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

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 FileReader interface {
	Glob(pattern string) ([]string, error)
	ReadFile(name string) ([]byte, error)
}

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.

Jump to

Keyboard shortcuts

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