Determines whether a path starts with an absolute path component (i.e. `/`, `c:/`, `file://`, etc.). ``` // POSIX PathIsAbsolute("/path/to/file.ext") === true // DOS PathIsAbsolute("c:/path/to/file.ext") === true // URL PathIsAbsolute("file:///path/to/file.ext") === true // Non-absolute Pa
(path string)
| 64 | // PathIsAbsolute("./path/to/file.ext") === false |
| 65 | // ``` |
| 66 | func PathIsAbsolute(path string) bool { |
| 67 | return GetEncodedRootLength(path) != 0 |
| 68 | } |
| 69 | |
| 70 | func HasTrailingDirectorySeparator(path string) bool { |
| 71 | return len(path) > 0 && isAnyDirectorySeparator(path[len(path)-1]) |