Documentation
¶
Overview ¶
Package filepathhelper contains path/filepath package helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangeExt ¶
ChangeExt changes extension of 'path' to 'ext'. 'ext' may or may not start with dot. If 'path' or 'ext' is empty or 'ext' is ".", 'path' is returned.
func EndSeparator ¶
EndSeparator returns 'path' guaranteed to end with filepath.Separator. If 'path' is empty, empty string is returned.
func Random ¶ added in v0.2.0
func Random() string
Random returns a random name (for directory or file).
func Split ¶ added in v0.1.0
Split splits 'path' (using filepath.Separator as separator) into slice of strings containing directory names and filename. (E.g. on Windows "a\b\c.d" is split into {"a", "b", "c.d"} slice.)
func StartSeparator ¶
StartSeparator returns 'path' guaranteed to start with filepath.Separator. If 'path' is empty, empty string is returned.
func WithoutExt ¶ added in v0.3.0
WithoutExt returns 'path' without extension and corresponding dot. If 'path' ends with dot, the dot is removed. If 'path' has no extension or is empty, 'path' is returned.
Types ¶
This section is empty.