MCPcopy Create free account
hub / github.com/bufbuild/buf / MapAllEqualOrContainingPathMap

Function MapAllEqualOrContainingPathMap

private/pkg/normalpath/normalpath_windows.go:100–113  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

98//
99// If the map is empty, returns nil.
100func 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//

Callers 1

imageWithOnlyPathsFunction · 0.92

Calls 1

EqualsOrContainsPathFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…