MCPcopy Create free account
hub / github.com/compose-spec/compose-go / Matches

Method Matches

tree/path.go:54–70  ·  view source on GitHub ↗
(pattern Path)

Source from the content-addressed store, hash-verified

52}
53
54func (p Path) Matches(pattern Path) bool {
55 patternParts := pattern.Parts()
56 parts := p.Parts()
57
58 if len(patternParts) != len(parts) {
59 return false
60 }
61 for index, part := range parts {
62 switch patternParts[index] {
63 case PathMatchAll, part:
64 continue
65 default:
66 return false
67 }
68 }
69 return true
70}
71
72func (p Path) Last() string {
73 parts := p.Parts()

Callers 12

resolveRelativePathsMethod · 0.80
checkFunction · 0.80
enforceUnicityFunction · 0.80
MergeYamlFunction · 0.80
TestPathMatchesFunction · 0.80
getCasterForPathMethod · 0.80
mustOmitFunction · 0.80
applyNullOverridesMethod · 0.80
processExtensionsFunction · 0.80
transformFunction · 0.80
setDefaultsFunction · 0.80
TestPathMatchesFunction · 0.80

Calls 1

PartsMethod · 0.95

Tested by 2

TestPathMatchesFunction · 0.64
TestPathMatchesFunction · 0.64