mirror of
https://github.com/kataras/iris.git
synced 2026-01-08 04:21:57 +00:00
allow handle same param path types with different macro functions as well, a use case: #1058
Former-commit-id: e7dcc5c0d9a2e3569e0f49303ff342bb8748baf5
This commit is contained in:
@@ -80,6 +80,7 @@ func NewRoute(method, subdomain, unparsedPath, mainHandlerName string,
|
||||
MainHandlerName: mainHandlerName,
|
||||
FormattedPath: formattedPath,
|
||||
}
|
||||
|
||||
return route, nil
|
||||
}
|
||||
|
||||
@@ -157,13 +158,20 @@ func (r Route) String() string {
|
||||
r.Method, r.Subdomain, r.Tmpl().Src)
|
||||
}
|
||||
|
||||
// Equal compares the method, subdomaind and the
|
||||
// Equal compares the method, subdomain and the
|
||||
// underline representation of the route's path,
|
||||
// instead of the `String` function which returns the front representation.
|
||||
func (r *Route) Equal(other *Route) bool {
|
||||
return r.Method == other.Method && r.Subdomain == other.Subdomain && r.Path == other.Path
|
||||
}
|
||||
|
||||
// DeepEqual compares the method, subdomain, the
|
||||
// underline representation of the route's path,
|
||||
// and the template source.
|
||||
func (r *Route) DeepEqual(other *Route) bool {
|
||||
return r.Equal(other) && r.tmpl.Src == other.tmpl.Src
|
||||
}
|
||||
|
||||
// Tmpl returns the path template,
|
||||
// it contains the parsed template
|
||||
// for the route's path.
|
||||
|
||||
Reference in New Issue
Block a user