From ae64f8aabdc1751565054920e50ffcd4fa74b7b0 Mon Sep 17 00:00:00 2001 From: Dominic Della Valle Date: Mon, 8 Jan 2018 20:19:04 -0500 Subject: [PATCH] Don't manually compare variable error string --- gxutil/pm.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gxutil/pm.go b/gxutil/pm.go index a8de892..5ed22a9 100644 --- a/gxutil/pm.go +++ b/gxutil/pm.go @@ -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 }