package execpath

import "github.com/rogpeppe/go-internal/internal/os/execpath"

Index

Variables

var ErrNotFound = exec.ErrNotFound

ErrNotFound is the error resulting if a path search failed to find an executable file.

Functions

func Look

func Look(file string, getenv func(string) string) (string, error)

Look searches for an executable named file, using getenv to look up environment variables. If getenv is nil, os.Getenv will be used. If file contains a slash, it is tried directly and getenv will not be called. The result may be an absolute path or a path relative to the current directory. Look also uses PATHEXT environment variable to match a suitable candidate.

Types

type Error

type Error = exec.Error

Source Files

exec.go lp_windows.go

Version
v1.14.1 (latest)
Published
Feb 25, 2025
Platform
windows/amd64
Imports
4 packages
Last checked
4 hours ago

Tools for package owners.