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

Method Dup

expr/http_response.go:325–343  ·  view source on GitHub ↗

Dup creates a copy of the response expression.

()

Source from the content-addressed store, hash-verified

323
324// Dup creates a copy of the response expression.
325func (r *HTTPResponseExpr) Dup() *HTTPResponseExpr {
326 res := HTTPResponseExpr{
327 StatusCode: r.StatusCode,
328 Description: r.Description,
329 ContentType: r.ContentType,
330 Parent: r.Parent,
331 Meta: r.Meta,
332 }
333 if r.Body != nil {
334 res.Body = DupAtt(r.Body)
335 }
336 if r.Headers != nil {
337 res.Headers = DupMappedAtt(r.Headers)
338 }
339 if r.Cookies != nil {
340 res.Cookies = DupMappedAtt(r.Cookies)
341 }
342 return &res
343}
344
345// mapUnmappedAttrs maps any unmapped attributes in ErrorResult type to the
346// response headers. Unmapped attributes refer to the attributes in ErrorResult

Callers

nothing calls this directly

Calls 2

DupAttFunction · 0.85
DupMappedAttFunction · 0.85

Tested by

no test coverage detected