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

Function pathToArray

agent/agentfiles/ls.go:179–189  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

177}
178
179func pathToArray(path string) []string {
180 out := strings.FieldsFunc(path, func(r rune) bool {
181 return r == os.PathSeparator
182 })
183 // Drive letters on Windows have a trailing separator as part of their name.
184 // i.e. `os.Open("C:")` does not work, but `os.Open("C:\\")` does.
185 if runtime.GOOS == "windows" && len(out) > 0 {
186 out[0] += string(os.PathSeparator)
187 }
188 return out
189}

Callers 4

TestListFilesSuccessFunction · 0.85
listFilesFunction · 0.85

Calls

no outgoing calls

Tested by 3

TestListFilesSuccessFunction · 0.68