FamiliarMatch reports whether ref matches the specified pattern. See https://godoc.org/path#Match for supported patterns.
(pattern string, ref Reference)
| 34 | // FamiliarMatch reports whether ref matches the specified pattern. |
| 35 | // See https://godoc.org/path#Match for supported patterns. |
| 36 | func FamiliarMatch(pattern string, ref Reference) (bool, error) { |
| 37 | matched, err := path.Match(pattern, FamiliarString(ref)) |
| 38 | if namedRef, isNamed := ref.(Named); isNamed && !matched { |
| 39 | matched, _ = path.Match(pattern, FamiliarName(namedRef)) |
| 40 | } |
| 41 | return matched, err |
| 42 | } |
searching dependent graphs…