mirror of
https://github.com/beego/bee.git
synced 2024-11-21 23:50:54 +00:00
trimspace @router
This commit is contained in:
parent
6bcf78a885
commit
7a5985d509
@ -320,7 +320,7 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat
|
|||||||
for _, c := range comments.List {
|
for _, c := range comments.List {
|
||||||
t := strings.TrimSpace(strings.TrimLeft(c.Text, "//"))
|
t := strings.TrimSpace(strings.TrimLeft(c.Text, "//"))
|
||||||
if strings.HasPrefix(t, "@router") {
|
if strings.HasPrefix(t, "@router") {
|
||||||
elements := t[len("@router "):]
|
elements := strings.TrimSpace(t[len("@router"):])
|
||||||
e1 := strings.SplitN(elements, " ", 2)
|
e1 := strings.SplitN(elements, " ", 2)
|
||||||
if len(e1) < 1 {
|
if len(e1) < 1 {
|
||||||
return errors.New("you should has router infomation")
|
return errors.New("you should has router infomation")
|
||||||
|
Loading…
Reference in New Issue
Block a user