MatchString reports whether "s" is literal of "literal" or it matches the regex expression at "regex".
(s string)
| 82 | // MatchString reports whether "s" is literal of "literal" |
| 83 | // or it matches the regex expression at "regex". |
| 84 | func (expr *NameExpr) MatchString(s string) bool { |
| 85 | if expr.literal == s { // if matches as string, as it's. |
| 86 | return true |
| 87 | } |
| 88 | |
| 89 | if expr.regex != nil { |
| 90 | return expr.regex.MatchString(s) |
| 91 | } |
| 92 | |
| 93 | return false |
| 94 | } |
| 95 | |
| 96 | // MatchFilename reports whether "filename" contains the "literal". |
| 97 | func (expr *NameExpr) MatchFilename(filename string) bool { |
no outgoing calls
no test coverage detected