removeMeta removes meta attributes from the given attribute that cannot be honored. This is needed to make sure that any field name overridding is removed when generating protobuf types (as protogen itself won't honor these overrides).
(att *expr.AttributeExpr)
| 118 | // removed when generating protobuf types (as protogen itself won't honor these |
| 119 | // overrides). |
| 120 | func removeMeta(att *expr.AttributeExpr) { |
| 121 | _ = codegen.Walk(att, func(a *expr.AttributeExpr) error { |
| 122 | delete(a.Meta, "struct:field:name") |
| 123 | delete(a.Meta, "struct:field:external") |
| 124 | delete(a.Meta, "struct.field.external") // Deprecated syntax. Only present for backward compatibility. |
| 125 | return nil |
| 126 | }) |
| 127 | } |
| 128 | |
| 129 | // transformAttribute returns the code to initialize a target data structure |
| 130 | // from an instance of source data structure. It returns an error if source and |
no test coverage detected