Help us shape the future of Go! Take the 2026 Go Developer Survey

exec

package
v1.16.21 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exec added in v1.16.0

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

func New

func New(t *testing.T, binPath string, args []string, fopts ...Option) *Exec

func (*Exec) Cleanup added in v1.16.0

func (e *Exec) Cleanup(t *testing.T)

func (*Exec) Kill added in v1.16.0

func (e *Exec) Kill(t *testing.T)

func (*Exec) Run added in v1.16.0

func (e *Exec) Run(t *testing.T, ctx context.Context)

type Option

type Option func(*options)

func WithEnvVars

func WithEnvVars(t *testing.T, envs ...string) Option

WithEnvVars sets the environment variables for the command. Expects a list of key value pairs.

func WithExitCode

func WithExitCode(code int) Option

func WithRunError

func WithRunError(ferr func(*testing.T, error)) Option

func WithStderr

func WithStderr(stderr io.WriteCloser) Option

func WithStdout

func WithStdout(stdout io.WriteCloser) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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