Skip to content

Commit 762f394

Browse files
Bryan C. Millsezz-no
Bryan C. Mills
authored andcommitted
doc: document os/exec changes on Windows
For golang#61422. Updates golang#62596. Updates golang#61493. Change-Id: I5c910f9961da24d90b3618ee53540118db06ff91 Reviewed-on: https://go-review.googlesource.com/c/go/+/548481 Auto-Submit: Bryan Mills <[email protected]> Reviewed-by: Alex Brainman <[email protected]> Reviewed-by: Cherry Mui <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent eae6c60 commit 762f394

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

doc/go1.22.html

+16-5
Original file line numberDiff line numberDiff line change
@@ -650,11 +650,22 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
650650
<dl id="os/exec"><dt><a href="/pkg/os/exec/">os/exec</a></dt>
651651
<dd>
652652
<p><!-- CL 528037 -->
653-
TODO: <a href="https://go.dev/cl/528037">https://go.dev/cl/528037</a>: os/exec: fix edge cases in Windows PATH resolution
654-
</p>
655-
656-
<p><!-- CL 528038 -->
657-
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
653+
On Windows, <a href="/pkg/os/exec#LookPath"><code>LookPath</code> now
654+
ignores empty entries in <code>%PATH%</code>, and returns
655+
<code>ErrNotFound</code> (instead of <code>ErrNotExist</code>) if
656+
no executable file extension is found to resolve an otherwise-unambiguous
657+
name.
658+
</p>
659+
660+
<p><!-- CL 528038, CL 527820 -->
661+
On Windows, <a href="/pkg/os/exec#Command"><code>Command</code></a> and
662+
<a href="/pkg/os/exec#Cmd.Start"><code>Cmd.Start</code></a> no
663+
longer call <code>LookPath</code> if the path to the executable is already
664+
absolute and has an executable file extension. In addition,
665+
<code>Cmd.Start</code> no longer writes the resolved extension back to
666+
the <a href="/pkg/os/exec#Cmd.Path"><code>Path</code></a> field,
667+
so it is now safe to call the <code>String</code> method concurrently
668+
with a call to <code>Start</code>.
658669
</p>
659670
</dd>
660671
</dl><!-- os/exec -->

0 commit comments

Comments
 (0)