Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecsInPath ¶
execsInPath returns a list of executables in the given path. The returned paths are absolute.
The given path should be an absolute path to a directory. If it's not a directory, the function will not proceed and return a nil slice.
lookalike accepts a function that returns true if the file name matches what we are expecting. Example:
func looksLikePip(name string) bool {
var pipFileRegex = regexp.MustCompile(`^pip3(\d(\.\d\d?)?)?$`)
return pipFileRegex.MatchString(name)
}
func IsDir ¶
IsDir returns true if the given path exists and is a directory. It delegates to os.Stat and FileInfo.IsDir.
func IsExecutable ¶
IsExecutable returns true if the given file info is executable. On Windows, it just checks if the file extension is ".exe" or not.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.