Files
wails/v2/pkg/parser/comments.go
2020-11-09 21:55:35 +11:00

22 lines
328 B
Go

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
}