diff options
author | Bryan C. Mills <bcmills@google.com> | 2022-04-20 17:07:14 -0400 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2022-04-21 17:37:05 +0000 |
commit | b34838913da606087b0f3141891f7d0fb2254eef (patch) | |
tree | e82ffa5fd4b077814e4d2fe55ca399325f6b81ff /doc | |
parent | 115852077f45141b293727558e61c0804661d328 (diff) | |
download | go-b34838913da606087b0f3141891f7d0fb2254eef.tar.gz go-b34838913da606087b0f3141891f7d0fb2254eef.zip |
os/exec: set PWD implicitly if Dir is non-empty and Env is nil
Fixes #50599.
Change-Id: I4e5dbb3972cdf21ede049567bfb98f2c992c5849
Reviewed-on: https://go-review.googlesource.com/c/go/+/401340
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/go1.19.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/doc/go1.19.html b/doc/go1.19.html index a813d59cb82..8305dececea 100644 --- a/doc/go1.19.html +++ b/doc/go1.19.html @@ -132,6 +132,21 @@ Do not send CLs removing the interior tags from such phrases. </dd> </dl><!-- net --> +<dl id="os/exec"><dt><a href="/pkg/os/exec/">os/exec</a></dt> + <dd><!-- https://go.dev/issue/50599 --> + <p> + An <code>exec.Cmd</code> with a non-empty <code>Dir</code> and a + nil <code>Env</code> now implicitly sets the <code>PWD</code> environment + variable for the subprocess to match <code>Dir</code>. + </p> + <p> + The new method <code>(*exec.Cmd).Environ</code> reports the + environment that would be used to run the command, including the + aforementioned <code>PWD</code> variable. + </p> + </dd> +</dl> <!-- os/exec --> + <dl id="runtime"><dt><a href="/pkg/runtime/">runtime</a></dt> <dd> <p><!-- https://go.dev/issue/51461 --> |