trimspace @router

This commit is contained in:
astaxie 2014-06-20 19:49:43 +08:00
parent 6bcf78a885
commit 7a5985d509
1 changed files with 1 additions and 1 deletions

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")