go library to find executables
A go library to find paths of executables
package main
import "github.com/jonhadfield/findexec"
func main() {
// find an executable called "diff" without specifying paths which will force
// searching of the system paths found in environment variable 'PATH'
_ = findexec.Find("diff", "")
// find an executable called "bash" in specific paths
_ = findexec.Find("bash", "/home/bin:/bin:/usr/local/bin")
}
The source code is made available under the terms of the Unlicense License, as stated in the file LICENSE.
This is rewrite of the find_executable() function provided in the python 2 standard library.