fix parser for go 1.15 (multiline comments)

This commit is contained in:
Alexandr Mayorskiy
2020-08-12 14:42:29 +03:00
parent f3f97e8f15
commit 8ab5ff9cd8
+8 -6
View File
@@ -45,13 +45,15 @@ func (p *Parser) needType(comments *ast.CommentGroup) (skip, explicit bool) {
}
}
comment = strings.TrimSpace(comment)
for _, comment := range strings.Split(comment, "\n") {
comment = strings.TrimSpace(comment)
if strings.HasPrefix(comment, structSkipComment) {
return true, false
}
if strings.HasPrefix(comment, structComment) {
return false, true
if strings.HasPrefix(comment, structSkipComment) {
return true, false
}
if strings.HasPrefix(comment, structComment) {
return false, true
}
}
}