mirror of
https://github.com/netbirdio/easyjson.git
synced 2026-05-22 18:44:42 -07:00
fix parser for go 1.15 (multiline comments)
This commit is contained in:
+8
-6
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user