From 18db59ad2de95bd4204fc5629a05fae6199d406b Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Fri, 23 Jun 2023 18:44:25 +0200 Subject: [PATCH] fix error comparison Signed-off-by: Jens Langhammer --- internal/utils/process.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/utils/process.go b/internal/utils/process.go index c53b4fc0e..0eff36d5b 100644 --- a/internal/utils/process.go +++ b/internal/utils/process.go @@ -1,6 +1,7 @@ package utils import ( + "errors" "fmt" "os" "syscall" @@ -21,7 +22,7 @@ func FindProcess(pid int) (*os.Process, error) { if err == nil { return proc, nil } - if err.Error() == "os: process already finished" { + if errors.Is(err, os.ErrProcessDone) { return nil, nil } errno, ok := err.(syscall.Errno)