Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasPrefix ¶
HasPrefix returns whether the slash-separated path p has the given prefix. Unlike strings.HasPrefix, this function respects component boundaries, so "/home/foo" is not a prefix is "/home/foobar/baz". If the prefix is empty, this function always returns true.
func RelBaseName ¶
RelBaseName returns the base name for rel, a slash-separated path relative to the repository root. If rel is empty, RelBaseName returns the base name of prefix. If prefix is empty, RelBaseName returns the base name of root, the absolute file path of the repository root directory. If that's empty to, then RelBaseName returns "root".
func TrimPrefix ¶
TrimPrefix returns p without the provided prefix. If p doesn't start with prefix, it returns p unchanged. Unlike strings.HasPrefix, this function respects component boundaries (assuming slash-separated paths), so TrimPrefix("foo/bar", "foo") returns "baz".
Types ¶
This section is empty.