Dup creates a copy of the response expression.
()
| 323 | |
| 324 | // Dup creates a copy of the response expression. |
| 325 | func (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 |
nothing calls this directly
no test coverage detected