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
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
package utils package utils
import ( import (
"errors"
"fmt" "fmt"
"os" "os"
"syscall" "syscall"
@ -21,7 +22,7 @@ func FindProcess(pid int) (*os.Process, error) {
if err == nil { if err == nil {
return proc, nil return proc, nil
} }
if err.Error() == "os: process already finished" { if errors.Is(err, os.ErrProcessDone) {
return nil, nil return nil, nil
} }
errno, ok := err.(syscall.Errno) errno, ok := err.(syscall.Errno)