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

Method useExplicitView

expr/result_type.go:197–205  ·  view source on GitHub ↗

useExplicitView projects the result type using the view explicitly set on the attribute if any.

()

Source from the content-addressed store, hash-verified

195// useExplicitView projects the result type using the view explicitly set on the
196// attribute if any.
197func (rt *ResultTypeExpr) useExplicitView() {
198 if view, ok := rt.Meta.Last(ViewMetaKey); ok {
199 p, err := Project(rt, view)
200 if err != nil {
201 panic(err) // bug - presence of view meta should have been validated before
202 }
203 *rt = *p
204 }
205}
206
207// ensureDefaultView builds the default view if not explicitly defined.
208func (rt *ResultTypeExpr) ensureDefaultView() {

Callers 1

FinalizeMethod · 0.95

Calls 2

ProjectFunction · 0.85
LastMethod · 0.80

Tested by

no test coverage detected