Documentation ¶
Index ¶
- func ContainsRelativePathSegments[T ~string](pth T) bool
- func ForEachAbsolutePathSegment[T ~string](pth T, fn func(segment string, startIndex, endIndex int) error) error
- func ForEachPathSegment[T ~string](pth T, fn func(segment string, startIndex, endIndex int) error) error
- func GetLastPathSegment(pth string) string
- func GetPathSegments[T ~string](pth T) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsRelativePathSegments ¶
ContainsRelativePathSegments reports whether $pth contains '.' or '..' segments.
func ForEachAbsolutePathSegment ¶
func ForEachAbsolutePathSegment[T ~string](pth T, fn func(segment string, startIndex, endIndex int) error) error
ForEachAbsolutePathSegment calls fn for each segment of pth, adjacent '/' characters are treated as a single '/' character. The path is not cleaned, so fn may be invoked with '.' or '..' as segment. The function panics if pth does not start with '/'.
func ForEachPathSegment ¶
func ForEachPathSegment[T ~string](pth T, fn func(segment string, startIndex, endIndex int) error) error
ForEachPathSegment calls fn for each segment of pth, adjacent '/' characters are treated as a single '/' character. The path is not cleaned, so fn may be invoked with '.' or '..' as segment.
func GetLastPathSegment ¶
func GetPathSegments ¶
GetPathSegments returns the segments of pth, adjacent '/' characters are treated as a single '/' character.
Types ¶
This section is empty.