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)
| 336 | // it returns one of them, along with a volume string that would be passed |
| 337 | // on the docker CLI (e.g. -v /bar -v /foo). |
| 338 | func setupPlatformVolume(u []string, w []string) ([]string, string) { |
| 339 | var a []string |
| 340 | if runtime.GOOS == "windows" { |
| 341 | a = w |
| 342 | } else { |
| 343 | a = u |
| 344 | } |
| 345 | s := "" |
| 346 | for _, v := range a { |
| 347 | s = s + "-v " + v + " " |
| 348 | } |
| 349 | return a, s |
| 350 | } |
| 351 | |
| 352 | // check if (a == c && b == d) || (a == d && b == c) |
| 353 | // because maps are randomized |
no outgoing calls
no test coverage detected
searching dependent graphs…