Skip to content

Commit

Permalink
Don't manually compare variable error string
Browse files Browse the repository at this point in the history
  • Loading branch information
djdv committed Jan 9, 2018
1 parent 41bf6c7 commit ae64f8a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gxutil/pm.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,11 @@ func getSubtoolPath(env string) (string, error) {
binname := "gx-" + env + binarySuffix
_, err := exec.LookPath(binname)
if err != nil {
if !strings.Contains(err.Error(), "file not found") {
if eErr, ok := err.(*exec.Error); ok {
if eErr.Err != exec.ErrNotFound {
return "", err
}
} else {
return "", err
}

Expand Down

0 comments on commit ae64f8a

Please sign in to comment.