Files

22 lines
328 B
Go
Raw Permalink Normal View History

2020-11-15 09:25:38 +11:00
package parser
import (
"go/ast"
"strings"
)
func parseComments(comments *ast.CommentGroup) []string {
var result []string
if comments == nil {
return result
}
for _, comment := range comments.List {
commentText := strings.TrimPrefix(comment.Text, "//")
result = append(result, commentText)
}
return result
}