MatchFilename reports whether "filename" contains the "literal".
(filename string)
| 95 | |
| 96 | // MatchFilename reports whether "filename" contains the "literal". |
| 97 | func (expr *NameExpr) MatchFilename(filename string) bool { |
| 98 | if filename == "" { |
| 99 | return false |
| 100 | } |
| 101 | |
| 102 | return strings.Contains(filename, expr.normalizedLiteral) |
| 103 | } |
| 104 | |
| 105 | // The regular expression to match the versioning and the domain part |
| 106 | var trimFileModuleNameRegex = regexp.MustCompile(`^[\w.]+/(kataras|iris-contrib)/|/v\d+|\.\*`) |