Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd interface { Run() error Start() error Wait() error KillProcess() error AppendExtraFiles(...*os.File) Args() []string SetIOStreams(io.Reader, io.Writer, io.Writer) Output() ([]byte, error) CombinedOutput() ([]byte, error) }
Cmd acts as a wrapper to functions exposed by the exec.Cmd object. Having this interface enables us to create mock objects we can use for testing.
type Exec ¶
type Exec interface { CommandContext(ctx context.Context, name string, arg ...string) Cmd ConvertToExitError(err error) (*exec.ExitError, bool) GetExitCode(exitErr *exec.ExitError) int NewExecContextWithTimeout(parent context.Context, duration time.Duration) (context.Context, context.CancelFunc) }
Exec acts as a wrapper to functions exposed by the exec package. Having this interface enables us to create mock objects we can use for testing.
Click to show internal directories.
Click to hide internal directories.