Black Lives Matter. Support the Equal Justice Initiative.

Package execabs

import "internal/execabs"

Overview ▾

Package execabs is a drop-in replacement for os/exec that requires PATH lookups to find absolute paths. That is, execabs.Command("cmd") runs the same PATH lookup as exec.Command("cmd"), but if the result is a path which is relative, the Run and Start methods will report an error instead of running the executable.


var ErrNotFound = exec.ErrNotFound

func Command

func Command(name string, arg ...string) *exec.Cmd

func CommandContext

func CommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd

func LookPath

func LookPath(file string) (string, error)

type Cmd

type Cmd = exec.Cmd

type Error

type Error = exec.Error

type ExitError

type ExitError = exec.ExitError