Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrDot = errors.New("cannot run executable found relative to current directory")
ErrDot indicates that a path lookup resolved to an executable in the current directory due to ‘.’ being in the path, either implicitly or explicitly. See the package documentation for details.
Note that functions in this package do not return ErrDot directly. Code should use errors.Is(err, ErrDot), not err == ErrDot, to test whether a returned error err is due to this condition.
var ErrNotFound = errors.New("executable file not found in $PATH")
ErrNotFound is the error resulting if a path search failed to find an executable file.
Functions ¶
func Look ¶
LookPath searches for an executable named file in the directories named by the `path` (env. variable). If file contains a slash, it is tried directly and the PATH is not consulted. Otherwise, on success, the result is an absolute path. See the https://cs.opensource.google/go/go/+/refs/tags/go1.21.6:src/os/exec/lp_unix.go;l=52 for further details.