Documentation ¶
Index ¶
- Constants
- Variables
- func EnvStringList(command *repb.Command) []string
- func ErrorResult(err error) *interfaces.CommandResult
- func ExitCode(ctx context.Context, cmd *exec.Cmd, err error) (int, error)
- func RetryIfTextFileBusy(fn func() error) error
- func Run(ctx context.Context, command *repb.Command, workDir string, stdin io.Reader, ...) *interfaces.CommandResult
Constants ¶
View Source
const ( // KilledExitCode is a special exit code value used by the "os/exec" package // when a process is killed. KilledExitCode = -1 // NoExitCode indicates a missing exit code value, usually because the process // never started, or its actual exit code could not be determined because of an // error. NoExitCode = -2 )
Variables ¶
View Source
var (
DebugStreamCommandOutputs = true
)
Functions ¶
func EnvStringList ¶
EnvStringList returns the command's environment variables as a list of string assignments. (Example: {"KEY1=VAL1", "KEY2=VAL2"})
func ErrorResult ¶
func ErrorResult(err error) *interfaces.CommandResult
func ExitCode ¶
exitCode returns the exit code from the given command, based on the error returned. If the command could not be started or did not exit cleanly, an error is returned.
func RetryIfTextFileBusy ¶
RetryIfTextFileBusy runs a function, retrying "text file busy" errors up to 3 times. This is a workaround for https://github.com/golang/go/issues/22315
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.