MCPcopy Create free account
hub / github.com/goadesign/goa / removeMeta

Function removeMeta

grpc/codegen/protobuf_transform.go:120–127  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

118// removed when generating protobuf types (as protogen itself won't honor these
119// overrides).
120func 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

Callers 2

protoBufTransformFunction · 0.70
addValidationFunction · 0.70

Calls 1

WalkFunction · 0.92

Tested by

no test coverage detected