Skip to content

Commit

Permalink
Merge pull request #1453 from Juneezee/refactor/errors.Is
Browse files Browse the repository at this point in the history
refactor(process): compare error with `errors.Is`
  • Loading branch information
shirou authored Apr 28, 2023
2 parents 17fac7c + 0439039 commit db89d12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion process/process_posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit db89d12

Please sign in to comment.