mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 04:07:47 +08:00
add returned error for ghttp.ClientResponse.Close
This commit is contained in:
parent
ebdad47f2d
commit
4ffe4f2262
@ -3,7 +3,6 @@
|
||||
// This Source Code Form is subject to the terms of the MIT License.
|
||||
// If a copy of the MIT was not distributed with this file,
|
||||
// You can obtain one at https://github.com/gogf/gf.
|
||||
// HTTP客户端请求返回.
|
||||
|
||||
package ghttp
|
||||
|
||||
@ -48,7 +47,7 @@ func (r *ClientResponse) ReadAllString() string {
|
||||
}
|
||||
|
||||
// 关闭返回的HTTP链接
|
||||
func (r *ClientResponse) Close() {
|
||||
func (r *ClientResponse) Close() error {
|
||||
r.Response.Close = true
|
||||
r.Body.Close()
|
||||
return r.Body.Close()
|
||||
}
|
@ -6,9 +6,12 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
q1 := gqueue.New(2)
|
||||
q1.Push(1)
|
||||
q1.Push(2)
|
||||
gtest.Assert(q1.Size(),2)
|
||||
max := 100
|
||||
for i := 0; i < 10; i++ {
|
||||
q := gqueue.New(max)
|
||||
for i := 1; i < max; i++ {
|
||||
q.Push(i)
|
||||
}
|
||||
gtest.Assert(q.Pop(), 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user