mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 17:21:02 +00:00
dont generate comment if router not found
This commit is contained in:
parent
4cba78afd9
commit
a1bc94e648
@ -118,6 +118,7 @@ func parserComments(f *ast.FuncDecl, controllerName, pkgpath string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if parsedComment.routerPath != "" {
|
||||||
key := pkgpath + ":" + controllerName
|
key := pkgpath + ":" + controllerName
|
||||||
cc := ControllerComments{}
|
cc := ControllerComments{}
|
||||||
cc.Method = f.Name.String()
|
cc.Method = f.Name.String()
|
||||||
@ -125,6 +126,7 @@ func parserComments(f *ast.FuncDecl, controllerName, pkgpath string) error {
|
|||||||
cc.AllowHTTPMethods = parsedComment.methods
|
cc.AllowHTTPMethods = parsedComment.methods
|
||||||
cc.MethodParams = buildMethodParams(f.Type.Params.List, parsedComment)
|
cc.MethodParams = buildMethodParams(f.Type.Params.List, parsedComment)
|
||||||
genInfoList[key] = append(genInfoList[key], cc)
|
genInfoList[key] = append(genInfoList[key], cc)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user