Documentation
¶
Overview ¶
Package pathutil provides some simple path related functions. Before using, please check the standard library's path and path/filepath functions to see if there is something more appropraite.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendSlash ¶
AppendSlash appends a slash, `/`, to the end of the passed string, if it doesn't already end with one. For OS independend filepaths, `/` are always used internally with OS-specific conversion occuring before interacting with the filesystem via filepath.FromSlash() and filepath.ToSlash()
func PathExists ¶
PathExists returns true if the given path exists, otherwise false. If an error is encountered, that is returned, otherwise error will be nil.
Since it not existing will cause an os.Stat error, we need to check if the error passed back is the IsNotExist error, which would mean the path does not exist, instead of an ectual error state.