aboutsummaryrefslogtreecommitdiff
path: root/src/os/exec/exec.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/exec/exec.go')
-rw-r--r--src/os/exec/exec.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/os/exec/exec.go b/src/os/exec/exec.go
index 0c495755116..505de58e84d 100644
--- a/src/os/exec/exec.go
+++ b/src/os/exec/exec.go
@@ -374,6 +374,9 @@ func lookExtensions(path, dir string) (string, error) {
// The Wait method will return the exit code and release associated resources
// once the command exits.
func (c *Cmd) Start() error {
+ if c.Path == "" && c.lookPathErr == nil {
+ c.lookPathErr = errors.New("exec: no command")
+ }
if c.lookPathErr != nil {
c.closeDescriptors(c.closeAfterStart)
c.closeDescriptors(c.closeAfterWait)