From b7431d6eeba20e073c50df98b8824261a6ccd270 Mon Sep 17 00:00:00 2001 From: qiulaidongfeng <2645477756@qq.com> Date: Sat, 1 Jun 2024 08:49:04 +0800 Subject: [PATCH] n Change-Id: Ibeb7ff0def24354435a3784dceb22245463a21f1 --- src/os/exec/exec.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/os/exec/exec.go b/src/os/exec/exec.go index b3bf5ec83cb..19d4bedfc8e 100644 --- a/src/os/exec/exec.go +++ b/src/os/exec/exec.go @@ -333,9 +333,9 @@ type Cmd struct { // and https://go.dev/issue/43724 for more context. lookPathErr error - // cacheLookExtensions cache the result of calling lookExtensions, - // set it only on windows. - cacheLookExtensions string + // cachedLookExtensions caches the result of calling lookExtensions. + // This is only used on Windows. + cachedLookExtensions string } // A ctxResult reports the result of watching the Context associated with a @@ -434,8 +434,7 @@ func Command(name string, arg ...string) *Cmd { // We may need to add a filename extension from PATHEXT // or verify an extension that is already present. // Since the path is absolute, its extension should be unambiguous - // and independent of cmd.Dir, and we can go ahead and update cmd.Path to - // reflect it. + // and independent of cmd.Dir, and we can go ahead and cache the lookup now. // // Note that we cannot add an extension here for relative paths, because // cmd.Dir may be set after we return from this function and that may cause