MCPcopy
hub / github.com/docker/compose / match

Function match

cmd/compose/list.go:68–84  ·  view source on GitHub ↗

match returns true if any of the values at key match the source string

(filters client.Filters, field, source string)

Source from the content-addressed store, hash-verified

66
67// match returns true if any of the values at key match the source string
68func match(filters client.Filters, field, source string) bool {
69 if f, ok := filters[field]; ok && f[source] {
70 return true
71 }
72
73 fieldValues := filters[field]
74 for name2match := range fieldValues {
75 isMatch, err := regexp.MatchString(name2match, source)
76 if err != nil {
77 continue
78 }
79 if isMatch {
80 return true
81 }
82 }
83 return false
84}
85
86func runList(ctx context.Context, dockerCli command.Cli, backendOptions *BackendOptions, lsOpts lsOptions) error {
87 filters := lsOpts.Filter.Value()

Callers 1

runListFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected