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

Method Finalize

expr/result_type.go:178–193  ·  view source on GitHub ↗

Finalize builds the default view if not explicitly defined and finalizes the underlying UserTypeExpr.

()

Source from the content-addressed store, hash-verified

176// Finalize builds the default view if not explicitly defined and finalizes
177// the underlying UserTypeExpr.
178func (rt *ResultTypeExpr) Finalize() {
179 rt.useExplicitView()
180 rt.ensureDefaultView()
181 rt.UserTypeExpr.Finalize()
182 seen := make(map[string]struct{})
183 walkAttribute(rt.AttributeExpr, func(_ string, att *AttributeExpr) error { // nolint: errcheck
184 if rt, ok := att.Type.(*ResultTypeExpr); ok {
185 if _, ok := seen[rt.Identifier]; !ok {
186 seen[rt.Identifier] = struct{}{}
187 rt.useExplicitView()
188 rt.ensureDefaultView()
189 }
190 }
191 return nil
192 })
193}
194
195// useExplicitView projects the result type using the view explicitly set on the
196// attribute if any.

Callers

nothing calls this directly

Calls 4

useExplicitViewMethod · 0.95
ensureDefaultViewMethod · 0.95
walkAttributeFunction · 0.85
FinalizeMethod · 0.65

Tested by

no test coverage detected