Merge pull request #1453 from Juneezee/refactor/errors.Is

refactor(process): compare error with `errors.Is`
tags/v3.23.4 v3.23.4
shirou 2 years ago committed by GitHub
commit db89d12010
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save