// Init creates a new runner and reads all available executables from the $PATH.
// If $PATH is unset, ErrNoEnvPath is returned.
Init creates a new runner and reads all available executables from the $PATH.
If $PATH is unset, ErrNoEnvPath is returned.
// Init creates a new runner and reads all available executables from the $PATH . // If $PATH is unset ErrNoEnvPath is returned .
func Init() (*Runner, error) {
	var envPath string
	var ok bool
	envPath, ok = os.LookupEnv("PATH")
	if !ok {
		return nil, ErrNoEnvPath
	}
	r := Runner{make(map[string]*string)}
	for _, folder := range strings.Split(envPath, pathSep) {
		r.hashFolder(folder)
	}
	return &r, nil
}
func Init ( ) ( * Runner , error ) { var envPath string var ok bool envPath , ok = os . LookupEnv ( " " ) if ! ok { return nil , ErrNoEnvPath } r := Runner { make ( map [ string ] * string ) } for _ , folder := range strings . Split ( envPath , pathSep ) { r . hashFolder ( folder ) } return & r , nil }
Init creates a new runner and reads all available executables from the $PATH.
Init creates a new runner and reads all available executables from the $PATH .