mirror of
https://github.com/beego/bee.git
synced 2024-11-24 03:20:55 +00:00
Fix staticcheck failed - cutset contains duplicate characters (SA1024)
This commit is contained in:
parent
f2696160ae
commit
22af6cc712
@ -541,7 +541,7 @@ func parserComments(f *ast.FuncDecl, controllerName, pkgpath string) error {
|
|||||||
//TODO: resultMap := buildParamMap(f.Type.Results)
|
//TODO: resultMap := buildParamMap(f.Type.Results)
|
||||||
if comments != nil && comments.List != nil {
|
if comments != nil && comments.List != nil {
|
||||||
for _, c := range comments.List {
|
for _, c := range comments.List {
|
||||||
t := strings.TrimSpace(strings.TrimLeft(c.Text, "//"))
|
t := strings.TrimSpace(strings.TrimPrefix(c.Text, "//"))
|
||||||
if strings.HasPrefix(t, "@router") {
|
if strings.HasPrefix(t, "@router") {
|
||||||
elements := strings.TrimSpace(t[len("@router"):])
|
elements := strings.TrimSpace(t[len("@router"):])
|
||||||
e1 := strings.SplitN(elements, " ", 2)
|
e1 := strings.SplitN(elements, " ", 2)
|
||||||
|
Loading…
Reference in New Issue
Block a user