mirror of
https://github.com/rwinkhart/sys.git
synced 2026-08-28 04:46:44 -04:00
execabs: isGo119ErrDot: use errors.Is instead of string-matching
Addresses the TODO added in CL 403256. Change-Id: Iae44242e00b6a309cc0f1e336462bc2d4995a5e2 GitHub-Last-Rev: 1adfdb799489c068127e5088cd131dcca79d86df GitHub-Pull-Request: golang/sys#142 Reviewed-on: https://go-review.googlesource.com/c/sys/+/448877 Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
This commit is contained in:
committed by
Gopher Robot
parent
fc697a31fa
commit
d684c6f886
@@ -7,9 +7,11 @@
|
|||||||
|
|
||||||
package execabs
|
package execabs
|
||||||
|
|
||||||
import "strings"
|
import (
|
||||||
|
"errors"
|
||||||
|
"os/exec"
|
||||||
|
)
|
||||||
|
|
||||||
func isGo119ErrDot(err error) bool {
|
func isGo119ErrDot(err error) bool {
|
||||||
// TODO: return errors.Is(err, exec.ErrDot)
|
return errors.Is(err, exec.ErrDot)
|
||||||
return strings.Contains(err.Error(), "current directory")
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user