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)
| 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). |
| 330 | func 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…