build

package
v1.235.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: Apache-2.0 Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package build compiles native Go plugins using the shared process runner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(ctx context.Context, directory string, options ...Option) (string, error)

Compile builds one plugin and returns its executable after atomic replacement. Use CompileAll when requesting multiple declared targets.

func CompileAll

func CompileAll(ctx context.Context, directory string, options ...Option) ([]string, error)

CompileAll builds the selected targets without executing them. All targets and destinations are validated first. On failure it returns completed paths; each completed binary remains available and the failed target's old binary survives.

func Run

func Run(ctx context.Context, directory string, options ...Option) error

Run compiles the package into its current-platform executable. A failed build leaves the previous executable intact, and a successful build never installs it.

Types

type Option

type Option func(*settings)

Option configures build execution without changing the package manifest.

func WithAllPlatforms

func WithAllPlatforms(value bool) Option

WithAllPlatforms builds every declared platform with bounded concurrency.

func WithPlatform

func WithPlatform(value string) Option

WithPlatform selects an explicitly declared OS/architecture[/variant] build target.

func WithRunner

func WithRunner(runner process.Runner) Option

WithRunner selects the subprocess implementation.

func WithStreams

func WithStreams(streams process.Streams) Option

WithStreams connects compiler output to the caller's streams.

Jump to

Keyboard shortcuts

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