]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: use os.ErrProcessDone rather than matching error string
authorIan Lance Taylor <iant@golang.org>
Tue, 5 Oct 2021 22:29:50 +0000 (15:29 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 5 Oct 2021 23:58:29 +0000 (23:58 +0000)
Change-Id: Ied57fb6e71d56618d46aeb36a37a709e08b4346e
Reviewed-on: https://go-review.googlesource.com/c/go/+/354136
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/script_test.go

index 3c5855bd6f24cfb088e725a9e1c6ce15b3eb87e1..17782420c7e10a31d7515680e579ceaba8a165ab 100644 (file)
@@ -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
                }