You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The name of an executable could be found in different paths (e.g, different versions of the same executable). LookPath is internally used to find what and retrieves something to run. Thus, I don't feel strong to modify what it retrieves to accomplish this purpose.
Instead, I've thought about a new function called LookPaths to give all possible matches of the wanted executable's name rather than the first matched occurrence.
For example, in case want all possible paths of bash:
Are there existing uses of similar functions?
Why should it be in the standard library? https://go.dev/doc/faq#x_in_std
This looks like something that could easily be done in user code
The package os/exec should provide a function which seeks and retrieves all possible paths of an executable's name instead of the first encountered. Meaning, flexibility on what we can use to run.
This looks like something that could easily be done in user code
I don't think so. If we adopt that way, user code would be merely a clone of the work done on os/exec, implementing not significant differences.
The name of an executable could be found in different paths (e.g, different versions of the same executable).
LookPath
is internally used to find what and retrieves something to run. Thus, I don't feel strong to modify what it retrieves to accomplish this purpose.Instead, I've thought about a new function called
LookPaths
to give all possible matches of the wanted executable's name rather than the first matched occurrence.For example, in case want all possible paths of
bash
:In regards to an archaic design of
LookPaths
:The text was updated successfully, but these errors were encountered: