From f1171e01f2db1fae0dde55584d656466bee0e441 Mon Sep 17 00:00:00 2001 From: guangwu Date: Tue, 11 Jul 2023 13:27:46 +0800 Subject: [PATCH] chore: slice replace loop (#3410) --- tools/goctl/pkg/parser/api/ast/writer.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/goctl/pkg/parser/api/ast/writer.go b/tools/goctl/pkg/parser/api/ast/writer.go index aafa0a68..42f40ebd 100644 --- a/tools/goctl/pkg/parser/api/ast/writer.go +++ b/tools/goctl/pkg/parser/api/ast/writer.go @@ -219,9 +219,7 @@ func transferTokenNode(node *TokenNode, opt ...tokenNodeOption) *TokenNode { } } if !option.ignoreLeadingComment { - for _, v := range node.LeadingCommentGroup { - result.LeadingCommentGroup = append(result.LeadingCommentGroup, v) - } + result.LeadingCommentGroup = append(result.LeadingCommentGroup, node.LeadingCommentGroup...) } return result }