hasGenerateComment checks if comment group contains //fory:generate
(commentGroup *ast.CommentGroup)
| 68 | |
| 69 | // hasGenerateComment checks if comment group contains //fory:generate |
| 70 | func hasGenerateComment(commentGroup *ast.CommentGroup) bool { |
| 71 | if commentGroup == nil { |
| 72 | return false |
| 73 | } |
| 74 | |
| 75 | for _, comment := range commentGroup.List { |
| 76 | if strings.Contains(comment.Text, "fory:generate") { |
| 77 | return true |
| 78 | } |
| 79 | } |
| 80 | return false |
| 81 | } |
| 82 | |
| 83 | // extractStructInfo extracts metadata from a struct type |
| 84 | func extractStructInfo(name string, structType *types.Struct) (*StructInfo, error) { |
no test coverage detected