Files
wails/v2/pkg/parser/comments.go
2020-11-07 07:03:04 +11:00

22 lines
340 B
Go

package parser
import (
"go/ast"
"strings"
)
func (p *Parser) 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
}