isWindowsAbsPath does a simplistic check for if the path is an absolute path on Windows. Drive letter or preceding `\` is interpreted as absolute.
(p string)
| 550 | // isWindowsAbsPath does a simplistic check for if the path is an absolute path |
| 551 | // on Windows. Drive letter or preceding `\` is interpreted as absolute. |
| 552 | func isWindowsAbsPath(p string) bool { |
| 553 | // Remove the drive letter, if present. |
| 554 | if len(p) >= 2 && p[1] == ':' { |
| 555 | p = p[2:] |
| 556 | } |
| 557 | |
| 558 | switch { |
| 559 | case len(p) == 0: |
| 560 | return false |
| 561 | case p[0] == '\\': |
| 562 | return true |
| 563 | default: |
| 564 | return false |
| 565 | } |
| 566 | } |
| 567 | |
| 568 | // windowsJoinPath joins the elements into a path, using Windows path separator |
| 569 | // and converting forward slashes to backslashes. |
no outgoing calls
no test coverage detected