1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-23 03:30:49 +00:00

method name refactor

This commit is contained in:
JessonChan 2015-09-18 17:59:28 +08:00
parent cc5abc6b30
commit 0ac690d2c8

View File

@ -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