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

Function project

expr/result_type.go:238–248  ·  view source on GitHub ↗
(rt *ResultTypeExpr, view string, seen map[string]*AttributeExpr)

Source from the content-addressed store, hash-verified

236}
237
238func project(rt *ResultTypeExpr, view string, seen map[string]*AttributeExpr) (*ResultTypeExpr, error) {
239 _, params, _ := mime.ParseMediaType(rt.Identifier)
240 if params["view"] == view {
241 // nothing to do
242 return rt, nil
243 }
244 if _, ok := rt.Type.(*Array); ok {
245 return projectCollection(rt, view, seen)
246 }
247 return projectSingle(rt, view, seen)
248}
249
250func projectSingle(rt *ResultTypeExpr, view string, seen map[string]*AttributeExpr) (*ResultTypeExpr, error) {
251 v := rt.View(view)

Callers 3

ProjectFunction · 0.85
projectCollectionFunction · 0.85
projectRecursiveFunction · 0.85

Calls 2

projectCollectionFunction · 0.85
projectSingleFunction · 0.85

Tested by

no test coverage detected