Group creates a new inline-Mux with a copy of middleware stack. It's useful for a group of handlers along the same routing path that use an additional set of middlewares. See _examples/.
(fn func(r Router))
| 260 | // for a group of handlers along the same routing path that use an additional |
| 261 | // set of middlewares. See _examples/. |
| 262 | func (mx *Mux) Group(fn func(r Router)) Router { |
| 263 | im := mx.With() |
| 264 | if fn != nil { |
| 265 | fn(im) |
| 266 | } |
| 267 | return im |
| 268 | } |
| 269 | |
| 270 | // Route creates a new Mux and mounts it along the `pattern` as a subrouter. |
| 271 | // Effectively, this is a short-hand call to Mount. See _examples/. |