mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
Call ReadAll() function in Close() of gClient
This commit is contained in:
@ -75,5 +75,6 @@ func (r *Response) Close() error {
|
||||
return nil
|
||||
}
|
||||
r.Response.Close = true
|
||||
r.ReadAll()
|
||||
return r.Response.Body.Close()
|
||||
}
|
||||
|
||||
@ -132,7 +132,6 @@ func ExampleNew_MultiConn_Recommend() {
|
||||
if r, err := client.Get(ctx, "http://127.0.0.1:8999/var/json"); err != nil {
|
||||
panic(err)
|
||||
} else {
|
||||
// Make sure call the ReadAllString() Funcion, Otherwise the program will block here
|
||||
fmt.Println(r.ReadAllString())
|
||||
r.Close()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user