Handler sets the Handler to be called when this Response Handler is the match for a given response. It registers the Response Handler in its parent Mux.
(h Handler)
| 271 | // Handler sets the Handler to be called when this Response Handler is the match for |
| 272 | // a given response. It registers the Response Handler in its parent Mux. |
| 273 | func (r *ResponseMatcher) Handler(h Handler) *ResponseMatcher { |
| 274 | r.mux.mu.Lock() |
| 275 | defer r.mux.mu.Unlock() |
| 276 | r.h = h |
| 277 | if !r.mux.res[r] { |
| 278 | r.mux.res[r] = true |
| 279 | } |
| 280 | return r |
| 281 | } |