mirror of
https://github.com/kataras/iris.git
synced 2025-12-17 18:07:01 +00:00
DBUG API: mark overlapped routes, hide the builtin functionality (read description)
also reference the correct file:line on <autogenerated> (by searching for the file,line of method inside the embedded fields themselves, as go automatically generates the methods foreach struct for their embedded fields) fix UseGlobal may override the overlap feature
This commit is contained in:
@@ -415,13 +415,19 @@ func (c *ControllerActivator) handleMany(method, path, funcName string, override
|
||||
}
|
||||
|
||||
func (c *ControllerActivator) saveRoutes(funcName string, routes []*router.Route, override bool) {
|
||||
m, ok := c.Type.MethodByName(funcName)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
sourceFileName, sourceLineNumber := getSourceFileLine(c.Type, m)
|
||||
|
||||
relName := c.RelName()
|
||||
for _, r := range routes {
|
||||
r.Description = relName
|
||||
r.MainHandlerName = fmt.Sprintf("%s.%s", relName, funcName)
|
||||
if m, ok := c.Type.MethodByName(funcName); ok {
|
||||
r.SourceFileName, r.SourceLineNumber = context.HandlerFileLineRel(m.Func)
|
||||
}
|
||||
|
||||
r.SourceFileName, r.SourceLineNumber = sourceFileName, sourceLineNumber
|
||||
}
|
||||
|
||||
// add this as a reserved method name in order to
|
||||
|
||||
Reference in New Issue
Block a user