go1.20.5
GoThrough

exec.ErrDot

// 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 ErrDot = errors.New("cannot run executable found relative to current directory")

exec.ErrNotFound

// ErrNotFound is the error resulting if a path search failed to find an executable file. var ErrNotFound = errors.New("executable file not found in $PATH")

exec.ErrNotFound

// ErrNotFound is the error resulting if a path search failed to find an executable file. var ErrNotFound = errors.New("executable file not found in $path")

exec.ErrNotFound

// ErrNotFound is the error resulting if a path search failed to find an executable file. var ErrNotFound = errors.New("executable file not found in $PATH")

exec.ErrNotFound

// ErrNotFound is the error resulting if a path search failed to find an executable file. var ErrNotFound = errors.New("executable file not found in %PATH%")

exec.ErrWaitDelay

// ErrWaitDelay is returned by (*Cmd).Wait if the process exits with a // successful status code but its output pipes are not closed before the // command's WaitDelay expires. var ErrWaitDelay = errors.New("exec: WaitDelay expired before I/O complete")

exec.Command

// Command returns the Cmd struct to execute the named program with // the given arguments. // // It sets only the Path and Args in the returned structure. // // If name contains no path separators, Command uses LookPath to // resolve name to a complete path if possible. Otherwise it uses name // directly as Path. // // The returned Cmd's Args field is constructed from the command name // followed by the elements of arg, so arg should not include the // command name itself. For example, Command("echo", "hello"). // Args[0] is always name, not the possibly resolved Path. // // On Windows, processes receive the whole command line as a single string // and do their own parsing. Command combines and quotes Args into a command // line string with an algorithm compatible with applications using // CommandLineToArgvW (which is the most common way). Notable exceptions are // msiexec.exe and cmd.exe (and thus, all batch files), which have a different // unquoting algorithm. In these or other similar cases, you can do the // quoting yourself and provide the full command line in SysProcAttr.CmdLine, // leaving Args empty. func Command(name string, arg ...string) *Cmd

exec.CommandContext

// CommandContext is like Command but includes a context. // // The provided context is used to interrupt the process // (by calling cmd.Cancel or os.Process.Kill) // if the context becomes done before the command completes on its own. // // CommandContext sets the command's Cancel function to invoke the Kill method // on its Process, and leaves its WaitDelay unset. The caller may change the // cancellation behavior by modifying those fields before starting the command. func CommandContext(ctx context.Context, name string, arg ...string) *Cmd

exec.LookPath

// LookPath searches for an executable named file in the // directories named by the PATH environment variable. // If file contains a slash, it is tried directly and the PATH is not consulted. // The result may be an absolute path or a path relative to the current directory. func LookPath(file string) (string, error)

exec.LookPath

// LookPath searches for an executable named file in the // directories named by the path environment variable. // If file begins with "/", "#", "./", or "../", it is tried // directly and the path is not consulted. // On success, the result is an absolute path. // // In older versions of Go, LookPath could return a path relative to the current directory. // As of Go 1.19, LookPath will instead return that path along with an error satisfying // errors.Is(err, ErrDot). See the package documentation for more details. func LookPath(file string) (string, error)

exec.LookPath

// LookPath searches for an executable named file in the // directories named by the PATH environment 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. // // In older versions of Go, LookPath could return a path relative to the current directory. // As of Go 1.19, LookPath will instead return that path along with an error satisfying // errors.Is(err, ErrDot). See the package documentation for more details. func LookPath(file string) (string, error)

exec.LookPath

// LookPath searches for an executable named file in the // directories named by the PATH environment variable. // LookPath also uses PATHEXT environment variable to match // a suitable candidate. // If file contains a slash, it is tried directly and the PATH is not consulted. // Otherwise, on success, the result is an absolute path. // // In older versions of Go, LookPath could return a path relative to the current directory. // As of Go 1.19, LookPath will instead return that path along with an error satisfying // errors.Is(err, ErrDot). See the package documentation for more details. func LookPath(file string) (string, error)