I am looking for a function to find a binary in all folders which are available in $PATH.
I know i can use os.Getenv("PATH") but it returns:
path: /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/go/bin
Which needs to be processed.
Ideally function like this: FindBinary("ntpq") and it will return the path + binary name and false when not found in path.
Does anybody have a ready function?