Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoShell = errors.New("no command shell found")
Error of Shell and ShellCommand when the platform names no command shell
Functions ¶
func ExitCode ¶
func ExitCode(state *os.ProcessState) int
Exit code of a finished process, the negated signal number when a signal ended it, -1 for a nil state
func ShellCommand ¶
Command that runs a command line through the POSIX shell as sh -c command
func WindowsCommandLine ¶
Windows command line of the arguments on any host, each quoted so CommandLineToArgvW and the C runtime read it back unchanged
Types ¶
type Completed ¶
Finished command with its exit code, the negated signal number when a signal ended it on Unix and -1 when it never ran, and both captured streams
type Options ¶
type Options struct {
Dir string
Env []string
Input []byte
Timeout time.Duration
RequireSuccess bool
Attr *syscall.SysProcAttr
}
Settings of one Run: nil Env inherits the environment, nil Input reads the null device, a positive Timeout kills the command once it passes, RequireSuccess makes a non-zero exit a *StatusError
type StatusError ¶
Non-zero exit of a command run with RequireSuccess, carrying its exit code and both captured streams
func (*StatusError) Error ¶
func (e *StatusError) Error() string
The command and how it ended, as in command ["git" "fetch"]: exit status 128
type TimeoutError ¶
Command killed for outliving its timeout, carrying the timeout and the output read before the kill
func (*TimeoutError) Error ¶
func (e *TimeoutError) Error() string
The command and its timeout, as in command ["sleep" "5"] timed out after 1s