mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 11:50:55 +00:00
method name refactor
This commit is contained in:
parent
cc5abc6b30
commit
0ac690d2c8
9
error.go
9
error.go
@ -376,13 +376,14 @@ func ErrorController(c ControllerInterface) *App {
|
||||
rt := reflectVal.Type()
|
||||
ct := reflect.Indirect(reflectVal).Type()
|
||||
for i := 0; i < rt.NumMethod(); i++ {
|
||||
if !utils.InSlice(rt.Method(i).Name, exceptMethod) && strings.HasPrefix(rt.Method(i).Name, "Error") {
|
||||
methodName := rt.Method(i).Name
|
||||
if !utils.InSlice(methodName, exceptMethod) && strings.HasPrefix(methodName, "Error") {
|
||||
errinfo := &errorInfo{}
|
||||
errinfo.errorType = errorTypeController
|
||||
errinfo.controllerType = ct
|
||||
errinfo.method = rt.Method(i).Name
|
||||
errname := strings.TrimPrefix(rt.Method(i).Name, "Error")
|
||||
ErrorMaps[errname] = errinfo
|
||||
errinfo.method = methodName
|
||||
errName := strings.TrimPrefix(methodName, "Error")
|
||||
ErrorMaps[errName] = errinfo
|
||||
}
|
||||
}
|
||||
return BeeApp
|
||||
|
Loading…
Reference in New Issue
Block a user