Are you able to modify the original question. Why do you need to know if a
binary exists? Presumably so you can execute it. If so then you can modify the
original request and make the problem more tractable.
--
You received this message because you are subscribed to the Google Groups
"golang-
package main
import (
"os"
"os/exec"
)
func main() {
cmdName := os.Args[1]
//either cmd or executable without arguments
if _, err := exec.LookPath(cmdName); err != nil {
if (err.(*exec.Error)).Err == exec.ErrNotFound {
// executable doesn't exist, do some