How to Enable HTTP Keep Alive in Go
- Share http transport — you can new http client every request but http transport must be shared.
- Read all response body.
- Response body must be closed.
- Set http header with “Connection: keep-alive”.