mirror of
https://github.com/wavetermdev/wails.git
synced 2026-04-22 15:26:15 -07:00
22 lines
328 B
Go
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
|
||
|
|
}
|