From ac60900759c29d9c06d9fe131825c4677e47d6a1 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Tue, 5 Oct 2021 15:29:50 -0700 Subject: [PATCH] cmd/go: use os.ErrProcessDone rather than matching error string Change-Id: Ied57fb6e71d56618d46aeb36a37a709e08b4346e Reviewed-on: https://go-review.googlesource.com/c/go/+/354136 Trust: Ian Lance Taylor Run-TryBot: Ian Lance Taylor TryBot-Result: Go Bot Reviewed-by: Bryan C. Mills --- src/cmd/go/script_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/go/script_test.go b/src/cmd/go/script_test.go index 3c5855bd6f..17782420c7 100644 --- a/src/cmd/go/script_test.go +++ b/src/cmd/go/script_test.go @@ -1172,7 +1172,7 @@ func waitOrStop(ctx context.Context, cmd *exec.Cmd, interrupt os.Signal, killDel err := cmd.Process.Signal(interrupt) if err == nil { err = ctx.Err() // Report ctx.Err() as the reason we interrupted. - } else if err.Error() == "os: process already finished" { + } else if err == os.ErrProcessDone { errc <- nil return } -- 2.50.0