execabs: isGo119ErrDot: use errors.Is instead of string-matching

Addresses the TODO added in CL 403256.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2022-11-09 10:40:45 +01:00
parent fc697a31fa
commit 1adfdb7994

View File

@@ -7,9 +7,11 @@
package execabs
import "strings"
import (
"errors"
"os/exec"
)
func isGo119ErrDot(err error) bool {
// TODO: return errors.Is(err, exec.ErrDot)
return strings.Contains(err.Error(), "current directory")
return errors.Is(err, exec.ErrDot)
}