Match returns true if the request matches all matchers in mset or if there are no matchers.
(r *http.Request)
| 348 | // Match returns true if the request matches all |
| 349 | // matchers in mset or if there are no matchers. |
| 350 | func (mset MatcherSet) Match(r *http.Request) bool { |
| 351 | for _, m := range mset { |
| 352 | if me, ok := m.(RequestMatcherWithError); ok { |
| 353 | match, _ := me.MatchWithError(r) |
| 354 | if !match { |
| 355 | return false |
| 356 | } |
| 357 | continue |
| 358 | } |
| 359 | if me, ok := m.(RequestMatcher); ok { |
| 360 | if !me.Match(r) { |
| 361 | return false |
| 362 | } |
| 363 | continue |
| 364 | } |
| 365 | return false |
| 366 | } |
| 367 | return true |
| 368 | } |
| 369 | |
| 370 | // MatchWithError returns true if r matches m. |
| 371 | func (mset MatcherSet) MatchWithError(r *http.Request) (bool, error) { |
nothing calls this directly
no test coverage detected