AddRoute registers a new Routable with Router
(route Route)
| 170 | |
| 171 | // AddRoute registers a new Routable with Router |
| 172 | func (g *Group) AddRoute(route Route) (RouteInfo, error) { |
| 173 | // Combine middleware into a new slice to avoid accidentally passing the same slice for |
| 174 | // multiple routes, which would lead to later add() calls overwriting the |
| 175 | // middleware from earlier calls. |
| 176 | groupRoute := route.WithPrefix(g.prefix, append([]MiddlewareFunc{}, g.middleware...)) |
| 177 | return g.echo.add(groupRoute) |
| 178 | } |
no test coverage detected