Skip to content

Commit db89d12

Browse files
authored
Merge pull request #1453 from Juneezee/refactor/errors.Is
refactor(process): compare error with `errors.Is`
2 parents 17fac7c + 0439039 commit db89d12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

process/process_posix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func PidExistsWithContext(ctx context.Context, pid int32) (bool, error) {
122122
if err == nil {
123123
return true, nil
124124
}
125-
if err.Error() == "os: process already finished" {
125+
if errors.Is(err, os.ErrProcessDone) {
126126
return false, nil
127127
}
128128
var errno syscall.Errno

0 commit comments

Comments
 (0)