Documentation ¶
Overview ¶
Package pathx provides additional utilities for working with paths.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExplicitlyRelative ¶
ExplicitlyRelative delegates the call to Setup.ExplicitlyRelative assuming Posix setup.
Types ¶
type Setup ¶
type Setup struct {
// contains filtered or unexported fields
}
Setup is a certain configuration of paths handling rules.
func Posix ¶
func Posix() Setup
Posix returns operating system independent setup conforming `posix` standards.
func (Setup) CutPrefix ¶
CutPrefix checks whether path has the given prefix and returns remaining path if it has. Path is considered to have a prefix only if the prefix hits at path delimiter boundary.
func (Setup) CutSuffix ¶
CutSuffix checks whether path has the given suffix and returns remaining path if it has. Path is considered to have a suffix only if the suffix hits at path delimiter boundary.
func (Setup) ExplicitlyRelative ¶
ExplicitlyRelative checks if p is a relative path and ensures it has '.' or '..' prefix. If it doesn't, '.' prefix is added. If it is absolute, original value is returned.