Documentation
¶
Index ¶
- Constants
- Variables
- func Abs(path string) (string, errors.Error)
- func AbsIn(wd, path string) (string, errors.Error)
- func AbsRoot(root, path string) (string, errors.Error)
- func Base(path string) string
- func BaseNoExt(path string) string
- func Clean(path string) string
- func Dir(path string) string
- func Ext(path string) string
- func IsAbs(path string) bool
- func IsIn(path, expectedParent string) (bool, errors.Error)
- func Join(parts ...string) string
- func NoExt(path string) string
Constants ¶
View Source
const ( // DefaultPathDelimiter denotes the character used to separate directory and file names in paths. DefaultPathDelimiter = filepath.Separator )
Variables ¶
View Source
var ( // Err occurs when using malformed paths. Err = errors.New("Malformed path") )
Functions ¶
func AbsIn ¶
AbsIn returns the absolute path as seen by a given working directory. The working directory is ignored for absolute paths.
func BaseNoExt ¶
BaseNoExt returns only the last part of a path excluding the file extension as returned by Ext.
func IsIn ¶
IsIn returns true when the given path is a (recursive) child of expectedParent. This method can be used for security checks.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.