Skip to content

Commit

Permalink
fix parser for go 1.15 (multiline comments)
Browse files Browse the repository at this point in the history
  • Loading branch information
GoWebProd committed Aug 12, 2020
1 parent f3f97e8 commit 8ab5ff9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}

Expand Down

0 comments on commit 8ab5ff9

Please sign in to comment.