From fdea8e21708e9ed04498a7f7b68cbee43005d58d Mon Sep 17 00:00:00 2001 From: hopehook Date: Mon, 3 Oct 2022 17:49:08 +0800 Subject: [PATCH] os/exec: document ProcessState available after a call to Wait or Run Wait or Run will populate its ProcessState when the command completes. Fixes #56002. Change-Id: I21547431f5d2d3e0fc0734fd1705421a0ac4209c Reviewed-on: https://go-review.googlesource.com/c/go/+/437996 Auto-Submit: Bryan Mills TryBot-Result: Gopher Robot Reviewed-by: Rob Pike Run-TryBot: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Reviewed-by: Bryan Mills Run-TryBot: Bryan Mills Reviewed-by: Ian Lance Taylor --- src/os/exec/exec.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/os/exec/exec.go b/src/os/exec/exec.go index e891ddca5a..aa601b6ccc 100644 --- a/src/os/exec/exec.go +++ b/src/os/exec/exec.go @@ -214,8 +214,9 @@ type Cmd struct { // Process is the underlying process, once started. Process *os.Process - // ProcessState contains information about an exited process, - // available after a call to Wait or Run. + // ProcessState contains information about an exited process. + // If the process was started successfully, Wait or Run will + // populate its ProcessState when the command completes. ProcessState *os.ProcessState ctx context.Context // nil means none -- 2.48.1