MCPcopy Create free account
hub / github.com/docker/cli / setupPlatformVolume

Function setupPlatformVolume

cli/command/container/opts_test.go:330–342  ·  view source on GitHub ↗

setupPlatformVolume takes two arrays of volume specs - a Unix style spec and a Windows style spec. Depending on the platform being unit tested, it returns one of them, along with a volume string that would be passed on the docker CLI (e.g. -v /bar -v /foo).

(u []string, w []string)

Source from the content-addressed store, hash-verified

328// it returns one of them, along with a volume string that would be passed
329// on the docker CLI (e.g. -v /bar -v /foo).
330func setupPlatformVolume(u []string, w []string) ([]string, string) {
331 var a []string
332 if runtime.GOOS == "windows" {
333 a = w
334 } else {
335 a = u
336 }
337 s := ""
338 for _, v := range a {
339 s = s + "-v " + v + " "
340 }
341 return a, s
342}
343
344// check if (a == c && b == d) || (a == d && b == c)
345// because maps are randomized

Callers 1

TestParseWithVolumesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…