run

package
v2.43.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PrepareCmd = func(cmd *exec.Cmd) Runnable {
	return &cmdWithStderr{cmd}
}

PrepareCmd extends exec.Cmd with extra error reporting features and provides a hook to stub command execution in tests

Functions

This section is empty.

Types

type CmdError

type CmdError struct {
	Args   []string
	Err    error
	Stderr *bytes.Buffer
}

CmdError provides more visibility into why an exec.Cmd had failed

func (CmdError) Error

func (e CmdError) Error() string

func (CmdError) Unwrap added in v2.30.0

func (e CmdError) Unwrap() error

type Runnable

type Runnable interface {
	Output() ([]byte, error)
	Run() error
}

Runnable is typically an exec.Cmd or its stub in tests

Jump to

Keyboard shortcuts

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