]> Cypherpunks repositories - gostls13.git/commitdiff
os/exec: document how Command fills in Cmd.Args
authorQuentin Smith <quentin@golang.org>
Fri, 21 Oct 2016 20:34:40 +0000 (16:34 -0400)
committerQuentin Smith <quentin@golang.org>
Fri, 28 Oct 2016 19:18:29 +0000 (19:18 +0000)
Fixes #17536

Change-Id: Ica8c3d696848822ac65b7931455b1fd94809bfe8
Reviewed-on: https://go-review.googlesource.com/31710
Reviewed-by: Russ Cox <rsc@golang.org>
src/os/exec/exec.go

index 234b3bda5f17f69de05d9335787a0c25c88542b1..a3a0f20ebc06ed9183df713541b2d6894dff983d 100644 (file)
@@ -120,12 +120,13 @@ type Cmd struct {
 // It sets only the Path and Args in the returned structure.
 //
 // If name contains no path separators, Command uses LookPath to
-// resolve the path to a complete name if possible. Otherwise it uses
-// name directly.
+// resolve name to a complete path if possible. Otherwise it uses name
+// directly as Path.
 //
 // The returned Cmd's Args field is constructed from the command name
 // followed by the elements of arg, so arg should not include the
-// command name itself. For example, Command("echo", "hello")
+// command name itself. For example, Command("echo", "hello").
+// Args[0] is always name, not the possibly resolved Path.
 func Command(name string, arg ...string) *Cmd {
        cmd := &Cmd{
                Path: name,