Skip to content

Commit

Permalink
only include valid docs in preprocess
Browse files Browse the repository at this point in the history
  • Loading branch information
JairusSW committed Nov 21, 2024
1 parent 847faa3 commit c9eb054
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sdk/go/tools/modus-go-build/codegen/preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,10 @@ func writeFuncWrappers(b *bytes.Buffer, pkg *packages.Package, imports map[strin
if fn.Doc != nil {
var docStrings []string
for _, comment := range fn.Doc.List {
docStrings = append(docStrings, comment.Text)
txt := comment.Text
if strings.HasPrefix(txt, "// ") {
docStrings = append(docStrings, txt)
}
}
b.WriteString(strings.Join(docStrings, "\n"))
b.WriteString("\n")
Expand Down

0 comments on commit c9eb054

Please sign in to comment.