@@ -26,7 +26,7 @@ import (
26
26
// ErrExecutableNotFound is returned if the executable is not found.
27
27
var ErrExecutableNotFound = osexec .ErrNotFound
28
28
29
- // Interface is an interface that presents a subset of the os/exec API. Use this
29
+ // Interface is an interface that presents a subset of the os/exec API. Use this
30
30
// when you want to inject fakeable/mockable exec behavior.
31
31
type Interface interface {
32
32
// Command returns a Cmd instance which can be used to run a single command.
@@ -38,13 +38,13 @@ type Interface interface {
38
38
}
39
39
40
40
// Cmd is an interface that presents an API that is very similar to Cmd from os/exec.
41
- // As more functionality is needed, this can grow. Since Cmd is a struct, we will have
41
+ // As more functionality is needed, this can grow. Since Cmd is a struct, we will have
42
42
// to replace fields with get/set method pairs.
43
43
type Cmd interface {
44
44
// Run runs the command to the completion.
45
45
Run () error
46
46
// CombinedOutput runs the command and returns its combined standard output
47
- // and standard error. This follows the pattern of package os/exec.
47
+ // and standard error. This follows the pattern of package os/exec.
48
48
CombinedOutput () ([]byte , error )
49
49
// Output runs the command and returns standard output, but not standard err
50
50
Output () ([]byte , error )
@@ -60,7 +60,7 @@ type Cmd interface {
60
60
}
61
61
62
62
// ExitError is an interface that presents an API similar to os.ProcessState, which is
63
- // what ExitError from os/exec is. This is designed to make testing a bit easier and
63
+ // what ExitError from os/exec is. This is designed to make testing a bit easier and
64
64
// probably loses some of the cross-platform properties of the underlying library.
65
65
type ExitError interface {
66
66
String () string
@@ -90,6 +90,8 @@ func (executor *executor) LookPath(file string) (string, error) {
90
90
// Wraps exec.Cmd so we can capture errors.
91
91
type cmdWrapper osexec.Cmd
92
92
93
+ var _ Cmd = & cmdWrapper {}
94
+
93
95
func (cmd * cmdWrapper ) SetDir (dir string ) {
94
96
cmd .Dir = dir
95
97
}
0 commit comments