fix error comparison

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens Langhammer 2023-06-23 18:44:25 +02:00
parent d3ef158360
commit 18db59ad2d
No known key found for this signature in database

View file

@ -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)