MCPcopy Index your code
hub / github.com/docker/cli / toWslPath

Function toWslPath

cli/command/telemetry_docker.go:177–183  ·  view source on GitHub ↗

toWslPath converts the referenced URL to a WSL-compatible path if this looks like a Windows absolute path. If no drive is in the URL, defaults to the C drive.

(s string)

Source from the content-addressed store, hash-verified

175//
176// If no drive is in the URL, defaults to the C drive.
177func toWslPath(s string) string {
178 drive, p, ok := parseUNCPath(s)
179 if !ok {
180 return ""
181 }
182 return fmt.Sprintf("mnt/%s%s", strings.ToLower(drive), p)
183}
184
185func parseUNCPath(s string) (drive, p string, ok bool) {
186 // UNC paths use backslashes but we're using forward slashes

Callers 1

wslSocketPathFunction · 0.85

Calls 1

parseUNCPathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…