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
1 changed files with 1 additions and 1 deletions

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)