getLocationFromRoute gets the URL location from a route using parameters. Nil receivers and missing routes return ErrNotFound to match Route.URL semantics.
(route *Route, params Map)
| 648 | // getLocationFromRoute gets the URL location from a route using parameters. |
| 649 | // Nil receivers and missing routes return ErrNotFound to match Route.URL semantics. |
| 650 | func (r *DefaultRes) getLocationFromRoute(route *Route, params Map) (string, error) { |
| 651 | if r == nil || route == nil || route.Path == "" { |
| 652 | return "", ErrNotFound |
| 653 | } |
| 654 | |
| 655 | return buildRouteURL(route, params) |
| 656 | } |
| 657 | |
| 658 | // GetRouteURL generates URLs to named routes, with parameters. URLs are relative, for example: "/user/1831" |
| 659 | func (r *DefaultRes) GetRouteURL(routeName string, params Map) (string, error) { |
no test coverage detected