diff options
| author | Patrick Mézard <patrick@mezard.eu> | 2014-02-23 12:53:02 -0800 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2014-02-23 12:53:02 -0800 |
| commit | d4b6a198b3b44c8c9617c72ceca9c32ba089b5a8 (patch) | |
| tree | 50db3ab353ed68d91f4a7a78fd57faaad617871d /src/pkg/os/exec/exec.go | |
| parent | 66f8ef868c5cc7e793a3ff83e4143e0dd4afaa98 (diff) | |
| download | go-d4b6a198b3b44c8c9617c72ceca9c32ba089b5a8.tar.xz | |
os/exec: explicitly mention Cmd.Wait() has to be called eventually
LGTM=minux.ma, r
R=golang-codereviews, minux.ma, r
CC=golang-codereviews
https://golang.org/cl/67280043
Diffstat (limited to 'src/pkg/os/exec/exec.go')
| -rw-r--r-- | src/pkg/os/exec/exec.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pkg/os/exec/exec.go b/src/pkg/os/exec/exec.go index 4680036fdd..d2cee03fcd 100644 --- a/src/pkg/os/exec/exec.go +++ b/src/pkg/os/exec/exec.go @@ -238,6 +238,9 @@ func (c *Cmd) Run() error { } // Start starts the specified command but does not wait for it to complete. +// +// The Wait method will return the exit code and release associated resources +// once the command exits. func (c *Cmd) Start() error { if c.lookPathErr != nil { c.closeDescriptors(c.closeAfterStart) @@ -304,6 +307,8 @@ func (e *ExitError) Error() string { // If the command fails to run or doesn't complete successfully, the // error is of type *ExitError. Other error types may be // returned for I/O problems. +// +// Wait releases any resources associated with the Cmd. func (c *Cmd) Wait() error { if c.Process == nil { return errors.New("exec: not started") |
