MapAllEqualOrContainingPathMap returns the paths in m that are equal to, or contain path, in a new map. The path and keys in m are expected to be normalized and validated if Relative is used. The path and keys in m are expected to be normalized and absolute if Absolute is used. If the map is empty
(m map[string]struct{}, path string, pathType PathType)
| 98 | // |
| 99 | // If the map is empty, returns nil. |
| 100 | func MapAllEqualOrContainingPathMap(m map[string]struct{}, path string, pathType PathType) map[string]struct{} { |
| 101 | if len(m) == 0 { |
| 102 | return nil |
| 103 | } |
| 104 | |
| 105 | n := make(map[string]struct{}) |
| 106 | |
| 107 | for potentialMatch := range m { |
| 108 | if EqualsOrContainsPath(potentialMatch, path, pathType) { |
| 109 | n[potentialMatch] = struct{}{} |
| 110 | } |
| 111 | } |
| 112 | return n |
| 113 | } |
| 114 | |
| 115 | // Components splits the path into its components. |
| 116 | // |
no test coverage detected
searching dependent graphs…