mirror of
https://github.com/genuinetools/reg.git
synced 2024-09-17 16:11:01 -04:00
25 lines
561 B
Go
25 lines
561 B
Go
|
package filters
|
||
|
|
||
|
func ExampleArgs_MatchKVList() {
|
||
|
args := NewArgs(
|
||
|
Arg("label", "image=foo"),
|
||
|
Arg("label", "state=running"))
|
||
|
|
||
|
// returns true because there are no values for bogus
|
||
|
args.MatchKVList("bogus", nil)
|
||
|
|
||
|
// returns false because there are no sources
|
||
|
args.MatchKVList("label", nil)
|
||
|
|
||
|
// returns true because all sources are matched
|
||
|
args.MatchKVList("label", map[string]string{
|
||
|
"image": "foo",
|
||
|
"state": "running",
|
||
|
})
|
||
|
|
||
|
// returns false because the values do not match
|
||
|
args.MatchKVList("label", map[string]string{
|
||
|
"image": "other",
|
||
|
})
|
||
|
}
|