MCPcopy Index your code
hub / github.com/coder/coder / isWindowsAbsPath

Function isWindowsAbsPath

cli/open.go:552–566  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
552func 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.

Callers 1

resolveAgentAbsPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected