build

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LookPath

func LookPath(file string) (string, error)

LookPath wraps exec.LookPath

func RunDiffTool

func RunDiffTool(ctx context.Context, diffTool, diffText string) error

RunDiffTool runs the specified diff tool and pipes the diff string to its stdin. This executes an external command, so it belongs in the internal/build or similar boundary package that handles os/exec.

Types

type BuildResult

type BuildResult struct {
	Name       string
	OutputPath string
	OutputSize int64
	Duration   time.Duration
	Success    bool
	Error      error
	Output     string
}

func (*BuildResult) String

func (r *BuildResult) String() string

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func NewBuilder

func NewBuilder(config Config) *Builder

func (*Builder) Build

func (b *Builder) Build(ctx context.Context) error

func (*Builder) BuildWithResult

func (b *Builder) BuildWithResult(ctx context.Context) *BuildResult

type Cleaner

type Cleaner struct {
	// contains filtered or unexported fields
}

func NewCleaner

func NewCleaner(binDir string, files []string) *Cleaner

func (*Cleaner) Clean

func (c *Cleaner) Clean(ctx context.Context) error

func (*Cleaner) CleanAll

func (c *Cleaner) CleanAll(ctx context.Context) error

func (*Cleaner) CleanCache

func (c *Cleaner) CleanCache(ctx context.Context) error

func (*Cleaner) CleanModCache

func (c *Cleaner) CleanModCache(ctx context.Context) error

func (*Cleaner) CleanTestCache

func (c *Cleaner) CleanTestCache(ctx context.Context) error

type Config

type Config struct {
	Name          string
	Path          string
	OutputDir     string
	Version       string
	GOOS          string
	GOARCH        string
	Race          bool
	LDFlags       []string
	BuildFlags    []string
	Tags          []string
	TrimPath      bool
	CGOEnabled    bool
	CGOConfigured bool
}

func DefaultConfig

func DefaultConfig(name, path string) Config

type Formatter

type Formatter struct{}

func NewFormatter

func NewFormatter() *Formatter

func (*Formatter) Format

func (f *Formatter) Format(ctx context.Context, paths ...string) error

func (*Formatter) FormatWithGofumpt

func (f *Formatter) FormatWithGofumpt(ctx context.Context, paths ...string) error

type InstallResult

type InstallResult struct {
	InstallDir string
	Installed  []string
	Failed     []string
}

type Installer

type Installer struct {
	// contains filtered or unexported fields
}

func NewInstaller

func NewInstaller(binDir string, binaries []string) *Installer

func (*Installer) GetInstallPath

func (i *Installer) GetInstallPath() (string, error)

func (*Installer) Install

func (i *Installer) Install(ctx context.Context) (*InstallResult, error)

func (*Installer) InstallTo

func (i *Installer) InstallTo(ctx context.Context, installDir string) (*InstallResult, error)

func (*Installer) IsInPath

func (i *Installer) IsInPath(dir string) bool

func (*Installer) Uninstall

func (i *Installer) Uninstall(ctx context.Context) error

func (*Installer) UninstallFrom

func (i *Installer) UninstallFrom(ctx context.Context, installDir string) error

type LintConfig

type LintConfig struct {
	Packages []string
	FixMode  bool
	Verbose  bool
	Fast     bool
	Timeout  string
}

func DefaultLintConfig

func DefaultLintConfig() LintConfig

type LintResult

type LintResult struct {
	Duration time.Duration
	Success  bool
	Error    error
	Output   string
}

func (*LintResult) String

func (r *LintResult) String() string

type Linter

type Linter struct {
	// contains filtered or unexported fields
}

func NewLinter

func NewLinter(config LintConfig) *Linter

func (*Linter) Lint

func (l *Linter) Lint(ctx context.Context) error

func (*Linter) LintWithResult

func (l *Linter) LintWithResult(ctx context.Context) *LintResult

type ModuleManager

type ModuleManager struct{}

func NewModuleManager

func NewModuleManager() *ModuleManager

func (*ModuleManager) Download

func (m *ModuleManager) Download(ctx context.Context) error

func (*ModuleManager) Graph

func (m *ModuleManager) Graph(ctx context.Context) error

func (*ModuleManager) Tidy

func (m *ModuleManager) Tidy(ctx context.Context) error

func (*ModuleManager) Vendor

func (m *ModuleManager) Vendor(ctx context.Context) error

func (*ModuleManager) Verify

func (m *ModuleManager) Verify(ctx context.Context) error

func (*ModuleManager) Why

func (m *ModuleManager) Why(ctx context.Context, packages ...string) error

type TestConfig

type TestConfig struct {
	WorkingDir   string
	Packages     []string
	Verbose      bool
	Race         bool
	Cover        bool
	CoverProfile string
	Short        bool
	Timeout      time.Duration
	Parallel     int
	RunPattern   string
	SkipPattern  string
	FailFast     bool
	Shuffle      string
}

func DefaultTestConfig

func DefaultTestConfig() TestConfig

type TestResult

type TestResult struct {
	Duration time.Duration
	Success  bool
	Error    error
	Output   string
}

func (*TestResult) String

func (r *TestResult) String() string

type Tester

type Tester struct {
	// contains filtered or unexported fields
}

func NewTester

func NewTester(config TestConfig) *Tester

func (*Tester) GenerateCoverageHTML

func (t *Tester) GenerateCoverageHTML(ctx context.Context, outputPath string) error

func (*Tester) Test

func (t *Tester) Test(ctx context.Context) error

func (*Tester) TestWithResult

func (t *Tester) TestWithResult(ctx context.Context) *TestResult

Jump to

Keyboard shortcuts

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