Expose Request.Write and Response.Read functions

This commit is contained in:
Adnan Maolood
2020-12-18 01:14:06 -05:00
parent c329a2487e
commit decd72cc23
4 changed files with 9 additions and 8 deletions

View File

@@ -78,14 +78,14 @@ func (c *Client) Do(req *Request) (*Response, error) {
// Write the request
w := bufio.NewWriter(conn)
req.write(w)
req.Write(w)
if err := w.Flush(); err != nil {
return nil, err
}
// Read the response
resp := &Response{}
if err := resp.read(conn); err != nil {
if err := resp.Read(conn); err != nil {
return nil, err
}
// Store connection state