mirror of
https://github.com/golang/sys.git
synced 2026-02-08 19:56:04 +03:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user