1
0
mirror of https://github.com/golang/go synced 2024-11-19 14:44:40 -07:00

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
This commit is contained in:
Patrick Mézard 2014-02-23 12:53:02 -08:00 committed by Rob Pike
parent 66f8ef868c
commit d4b6a198b3

View 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")