]> Cypherpunks repositories - gostls13.git/commitdiff
doc: document os/exec changes on Windows
authorBryan C. Mills <bcmills@google.com>
Fri, 8 Dec 2023 22:01:43 +0000 (17:01 -0500)
committerGopher Robot <gobot@golang.org>
Mon, 11 Dec 2023 16:13:01 +0000 (16:13 +0000)
For #61422.
Updates #62596.
Updates #61493.

Change-Id: I5c910f9961da24d90b3618ee53540118db06ff91
Reviewed-on: https://go-review.googlesource.com/c/go/+/548481
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

doc/go1.22.html

index b363aaf14bf980a25756982a00dd77d8fff64649..bbd71b5893fb1ac525bc2b72a08e48c55064625d 100644 (file)
@@ -650,11 +650,22 @@ defer func() {
 <dl id="os/exec"><dt><a href="/pkg/os/exec/">os/exec</a></dt>
   <dd>
     <p><!-- CL 528037 -->
-      TODO: <a href="https://go.dev/cl/528037">https://go.dev/cl/528037</a>: os/exec: fix edge cases in Windows PATH resolution
-    </p>
-
-    <p><!-- CL 528038 -->
-      TODO: <a href="https://go.dev/cl/528038">https://go.dev/cl/528038</a>: os/exec: avoid calling LookPath in cmd.Start for resolved paths
+      On Windows, <a href="/pkg/os/exec#LookPath"><code>LookPath</code> now
+      ignores empty entries in <code>%PATH%</code>, and returns
+      <code>ErrNotFound</code> (instead of <code>ErrNotExist</code>) if
+      no executable file extension is found to resolve an otherwise-unambiguous
+      name.
+    </p>
+
+    <p><!-- CL 528038, CL 527820 -->
+      On Windows, <a href="/pkg/os/exec#Command"><code>Command</code></a> and
+      <a href="/pkg/os/exec#Cmd.Start"><code>Cmd.Start</code></a> no
+      longer call <code>LookPath</code> if the path to the executable is already
+      absolute and has an executable file extension. In addition,
+      <code>Cmd.Start</code> no longer writes the resolved extension back to
+      the <a href="/pkg/os/exec#Cmd.Path"><code>Path</code></a> field,
+      so it is now safe to call the <code>String</code> method concurrently
+      with a call to <code>Start</code>.
     </p>
   </dd>
 </dl><!-- os/exec -->