mirror of
https://github.com/golang/sys.git
synced 2026-01-29 07:02:06 +03:00
execabs: isGo119ErrDot: use errors.Is instead of string-matching
Addresses the TODO added in CL 403256.
Change-Id: Iae44242e00b6a309cc0f1e336462bc2d4995a5e2
GitHub-Last-Rev: 1adfdb7994
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
|
||||
|
||||
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