Close releases both the Request and Response objects back to their pools. After calling Close, do not use these objects.
()
| 206 | // Close releases both the Request and Response objects back to their pools. |
| 207 | // After calling Close, do not use these objects. |
| 208 | func (r *Response) Close() { |
| 209 | if r.request != nil { |
| 210 | tmp := r.request |
| 211 | r.request = nil |
| 212 | ReleaseRequest(tmp) |
| 213 | } |
| 214 | ReleaseResponse(r) |
| 215 | } |
| 216 | |
| 217 | var responsePool = &sync.Pool{ |
| 218 | New: func() any { |