2022-03-16 21:24:54 +00:00
|
|
|
// +build linux darwin
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
)
|
|
|
|
|
2022-03-16 22:44:54 +00:00
|
|
|
func findExecutable(path string) error {
|
2022-03-16 21:24:54 +00:00
|
|
|
f, err := os.Stat(path)
|
|
|
|
if err != nil {
|
2022-03-16 22:44:54 +00:00
|
|
|
return err
|
2022-03-16 21:24:54 +00:00
|
|
|
}
|
|
|
|
if m := f.Mode(); !m.IsDir() && m & 0111 != 0 {
|
2022-03-16 22:44:54 +00:00
|
|
|
return nil
|
2022-03-16 21:24:54 +00:00
|
|
|
}
|
2022-03-16 22:44:54 +00:00
|
|
|
return errNotExec
|
2022-03-16 21:24:54 +00:00
|
|
|
}
|