internal

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(ctx context.Context, pkgdir string, f func(*exec.Cmd) error) error

func LoadPkg

func LoadPkg(ctx context.Context, pkgdir, pkgname string, scope *types.Scope, f func(*exec.Cmd) error) error

func LoadTargets

func LoadTargets(ctx context.Context, pkgdir, pkgname string, targets []string, f func(*exec.Cmd) error) error

func Run

func Run(ctx context.Context, pkgdir string, args ...string) error

Run uses Load to load the Go package in the given directory and turn it into an executable binary. It then runs the program as:

PROG [-v] CWD TMPFILE ARGS...

where CWD is the current working directory, TMPFILE is the name of a temporary file where the program sends its output, and ARGS are the additional arguments passed to Run.

Run parses the output in the temporary file: a JSON-encoded list of error strings. If the list is empty, Run returns nil. Otherwise it converts those strings to an error (using multierr.Combine if there are two or more) and returns it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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