1
0
mirror of https://github.com/beego/bee.git synced 2024-11-21 18:40:54 +00:00

trimspace @router

This commit is contained in:
astaxie 2014-06-20 19:49:43 +08:00
parent 6bcf78a885
commit 7a5985d509

View File

@ -320,7 +320,7 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat
for _, c := range comments.List {
t := strings.TrimSpace(strings.TrimLeft(c.Text, "//"))
if strings.HasPrefix(t, "@router") {
elements := t[len("@router "):]
elements := strings.TrimSpace(t[len("@router"):])
e1 := strings.SplitN(elements, " ", 2)
if len(e1) < 1 {
return errors.New("you should has router infomation")