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

Function platformAbsPath

agent/agent_internal_test.go:25–30  ·  view source on GitHub ↗

platformAbsPath constructs an absolute path that is valid on the current platform. On Windows, paths must include a drive letter to be considered absolute.

(parts ...string)

Source from the content-addressed store, hash-verified

23// on the current platform. On Windows, paths must include a
24// drive letter to be considered absolute.
25func platformAbsPath(parts ...string) string {
26 if runtime.GOOS == "windows" {
27 return `C:\` + filepath.Join(parts...)
28 }
29 return "/" + filepath.Join(parts...)
30}
31
32// TestReportConnectionEmpty tests that reportConnection() doesn't choke if given an empty IP string, which is what we
33// send if we cannot get the remote address.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected