diff --git a/process/process_posix.go b/process/process_posix.go index 36c6a47..7bd9b05 100644 --- a/process/process_posix.go +++ b/process/process_posix.go @@ -122,7 +122,7 @@ func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) { if err == nil { return true, nil } - if err.Error() == "os: process already finished" { + if errors.Is(err, os.ErrProcessDone) { return false, nil } var errno syscall.Errno