matchesName returns whether the location matches the regular expression. It checks any available function names, file names, and mapping object filename.
(re *regexp.Regexp)
| 177 | // expression. It checks any available function names, file names, and |
| 178 | // mapping object filename. |
| 179 | func (loc *Location) matchesName(re *regexp.Regexp) bool { |
| 180 | for _, ln := range loc.Line { |
| 181 | if fn := ln.Function; fn != nil { |
| 182 | if re.MatchString(fn.Name) || re.MatchString(fn.Filename) { |
| 183 | return true |
| 184 | } |
| 185 | } |
| 186 | } |
| 187 | if m := loc.Mapping; m != nil && re.MatchString(m.File) { |
| 188 | return true |
| 189 | } |
| 190 | return false |
| 191 | } |
| 192 | |
| 193 | // unmatchedLines returns the lines in the location that do not match |
| 194 | // the regular expression. |