findOverlayLowerdirs returns the index of lowerdir in mount's options and all the lowerdir target.
(opts []string)
| 444 | // findOverlayLowerdirs returns the index of lowerdir in mount's options and |
| 445 | // all the lowerdir target. |
| 446 | func findOverlayLowerdirs(opts []string) (int, []string) { |
| 447 | var ( |
| 448 | idx = -1 |
| 449 | prefix = "lowerdir=" |
| 450 | ) |
| 451 | |
| 452 | for i, opt := range opts { |
| 453 | if strings.HasPrefix(opt, prefix) { |
| 454 | idx = i |
| 455 | break |
| 456 | } |
| 457 | } |
| 458 | |
| 459 | if idx == -1 { |
| 460 | return -1, nil |
| 461 | } |
| 462 | return idx, strings.Split(opts[idx][len(prefix):], ":") |
| 463 | } |
| 464 | |
| 465 | // longestCommonPrefix finds the longest common prefix in the string slice. |
| 466 | func longestCommonPrefix(strs []string) string { |
no outgoing calls
no test coverage detected
searching dependent graphs…