1
0
mirror of https://github.com/beego/bee.git synced 2024-12-24 03:00:49 +00:00

Fix staticcheck failed - cutset contains duplicate characters (SA1024)

This commit is contained in:
Tavee Khunbida 2019-01-08 01:07:11 +07:00
parent f2696160ae
commit 22af6cc712

View File

@ -541,7 +541,7 @@ func parserComments(f *ast.FuncDecl, controllerName, pkgpath string) error {
//TODO: resultMap := buildParamMap(f.Type.Results)
if comments != nil && comments.List != nil {
for _, c := range comments.List {
t := strings.TrimSpace(strings.TrimLeft(c.Text, "//"))
t := strings.TrimSpace(strings.TrimPrefix(c.Text, "//"))
if strings.HasPrefix(t, "@router") {
elements := strings.TrimSpace(t[len("@router"):])
e1 := strings.SplitN(elements, " ", 2)