Documentation ¶
Index ¶
- func AttachConsole() error
- func CompareSemVer(oldVer, newVer string) int
- func DownloadWriter(URL string, w io.Writer) error
- func FindDirectoriesBySuffix(root, suffix string, ignoreAccessErrors bool) (results []string, err error)
- func FixRedirection() error
- func FreeConsole() error
- func SplitFilepath(name string) (fpath, fname, ext string)
- func StripPathParts(path string, stripRight int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachConsole ¶
func AttachConsole() error
AttachConsole gives us access to the parent console on Windows, when built as a GUI application, where the console would otherwise not be available.
func CompareSemVer ¶
CompareSemVer returns 1 if the semantic version `newVer` is greater than `oldVer` and -1 otherwise. A semantic version is one that follows the format "1.2.3". If either oldVer or newVer startss with the letter "v", it will be stripped before comparison, along with any hyphenenated (-) suffix. (e.g: "v0.1-alpha" becomes "0.1")
func DownloadWriter ¶
DownloadWriter retrieves a file from a given URL, and writes the returned contents into the given writer, making sure a status 200 OK was returned.
func FindDirectoriesBySuffix ¶
func FindDirectoriesBySuffix(root, suffix string, ignoreAccessErrors bool) (results []string, err error)
FindDirectoriesBySuffix searches the given root recursively and returns all paths where the last directory component has the supplied suffix, optionally ignoring errors "access denied" and "permission denied"
func FixRedirection ¶
func FixRedirection() error
FixRedirection restores the parent console's ability to redirect this program's output through a pipe to a file or device, where without doing so, the output would be forced to the console even if redirected.
func FreeConsole ¶
func FreeConsole() error
FreeConsole would relinquish our control of the parent console on Windows ? but is it actually necessary ? requires more testing TODO: NOT YET IMPLEMENTED
func SplitFilepath ¶
SplitFilepath takes a relative or absolute path to a file, and returns the separated path, filename, and file extension. If an extension is present, it will start with a dot character, otherwise it will be an empty string.
func StripPathParts ¶
StripPathParts takes a given filepath and removes the specified number of path parts; if stripRight is positive, they are removed from the right (end), if negative, they are removed from the left (beginning).
Types ¶
This section is empty.