1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 11:40:55 +00:00

dont generate comment if router not found

This commit is contained in:
eyalpost 2017-04-26 01:00:25 +03:00
parent 4cba78afd9
commit a1bc94e648

View File

@ -118,13 +118,15 @@ func parserComments(f *ast.FuncDecl, controllerName, pkgpath string) error {
if err != nil { if err != nil {
return err return err
} }
key := pkgpath + ":" + controllerName if parsedComment.routerPath != "" {
cc := ControllerComments{} key := pkgpath + ":" + controllerName
cc.Method = f.Name.String() cc := ControllerComments{}
cc.Router = parsedComment.routerPath cc.Method = f.Name.String()
cc.AllowHTTPMethods = parsedComment.methods cc.Router = parsedComment.routerPath
cc.MethodParams = buildMethodParams(f.Type.Params.List, parsedComment) cc.AllowHTTPMethods = parsedComment.methods
genInfoList[key] = append(genInfoList[key], cc) cc.MethodParams = buildMethodParams(f.Type.Params.List, parsedComment)
genInfoList[key] = append(genInfoList[key], cc)
}
} }
return nil return nil