Skip to content

Commit

Permalink
execabs: isGo119ErrDot: use errors.Is instead of string-matching
Browse files Browse the repository at this point in the history
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 <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>
  • Loading branch information
thaJeztah authored and gopherbot committed Nov 10, 2022
1 parent fc697a3 commit d684c6f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions execabs/execabs_go119.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit d684c6f

Please sign in to comment.