diff --git a/helper/discover/discover.go b/helper/discover/discover.go index 8d1416ab6f56..b683e95a793b 100644 --- a/helper/discover/discover.go +++ b/helper/discover/discover.go @@ -32,11 +32,6 @@ func NomadExecutable() (string, error) { } // Check the CWD. - bin = filepath.Join(os.Getenv("GOPATH"), "bin", nomadExe) - if _, err := os.Stat(bin); err == nil { - return bin, nil - } - pwd, err := os.Getwd() if err != nil { return "", fmt.Errorf("Could not find Nomad executable (%v): %v", err) @@ -47,5 +42,11 @@ func NomadExecutable() (string, error) { return bin, nil } + // Check CWD/bin + bin = filepath.Join(pwd, "bin", nomadExe) + if _, err := os.Stat(bin); err == nil { + return bin, nil + } + return "", fmt.Errorf("Could not find Nomad executable (%v)", nomadExe) }