MCPcopy Create free account
hub / github.com/docker/cli / matches

Method matches

cli/compose/interpolation/interpolation.go:142–158  ·  view source on GitHub ↗
(pattern Path)

Source from the content-addressed store, hash-verified

140}
141
142func (p Path) matches(pattern Path) bool {
143 patternParts := pattern.parts()
144 parts := p.parts()
145
146 if len(patternParts) != len(parts) {
147 return false
148 }
149 for index, part := range parts {
150 switch patternParts[index] {
151 case PathMatchAll, part:
152 continue
153 default:
154 return false
155 }
156 }
157 return true
158}
159
160func (o Options) getCasterForPath(path Path) (Cast, bool) {
161 for pattern, caster := range o.TypeCastMapping {

Callers 2

TestPathMatchesFunction · 0.80
getCasterForPathMethod · 0.80

Calls 1

partsMethod · 0.95

Tested by 1

TestPathMatchesFunction · 0.64