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

Function platformAbsPath

agent/agentcontextconfig/resolve_test.go:16–21  ·  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

14// on the current platform. On Windows paths must include a
15// drive letter to be considered absolute.
16func platformAbsPath(parts ...string) string {
17 if runtime.GOOS == "windows" {
18 return `C:\` + filepath.Join(parts...)
19 }
20 return "/" + filepath.Join(parts...)
21}
22
23func TestResolvePath(t *testing.T) { //nolint:tparallel // subtests using t.Setenv cannot be parallel
24 t.Run("EmptyInput", func(t *testing.T) {

Callers 5

TestResolvePathFunction · 0.70
TestResolvePathsFunction · 0.70
TestResolveFunction · 0.70
TestNewAPI_LazyDirectoryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected