Skip to content

Commit d684c6f

Browse files
thaJeztahgopherbot
authored andcommitted
execabs: isGo119ErrDot: use errors.Is instead of string-matching
Addresses the TODO added in CL 403256. Change-Id: Iae44242e00b6a309cc0f1e336462bc2d4995a5e2 GitHub-Last-Rev: 1adfdb7 GitHub-Pull-Request: #142 Reviewed-on: https://go-review.googlesource.com/c/sys/+/448877 Auto-Submit: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent fc697a3 commit d684c6f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

execabs/execabs_go119.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
package execabs
99

10-
import "strings"
10+
import (
11+
"errors"
12+
"os/exec"
13+
)
1114

1215
func isGo119ErrDot(err error) bool {
13-
// TODO: return errors.Is(err, exec.ErrDot)
14-
return strings.Contains(err.Error(), "current directory")
16+
return errors.Is(err, exec.ErrDot)
1517
}

0 commit comments

Comments
 (0)