]> Cypherpunks repositories - gostls13.git/commitdiff
os/exec: explicitly mention Cmd.Wait() has to be called eventually
authorPatrick Mézard <patrick@mezard.eu>
Sun, 23 Feb 2014 20:53:02 +0000 (12:53 -0800)
committerRob Pike <r@golang.org>
Sun, 23 Feb 2014 20:53:02 +0000 (12:53 -0800)
LGTM=minux.ma, r
R=golang-codereviews, minux.ma, r
CC=golang-codereviews
https://golang.org/cl/67280043

src/pkg/os/exec/exec.go

index 4680036fddcc6eefc19db1cbff5b1bbe59ceb0e9..d2cee03fcd0277861c5903a27a8f8fc84b35b66c 100644 (file)
@@ -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")