diff --git a/g/net/ghttp/ghttp_client_response.go b/g/net/ghttp/ghttp_client_response.go index c9dd587d4..e2bf13e74 100644 --- a/g/net/ghttp/ghttp_client_response.go +++ b/g/net/ghttp/ghttp_client_response.go @@ -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() } \ No newline at end of file diff --git a/geg/other/test.go b/geg/other/test.go index 49c122b37..dae805c09 100644 --- a/geg/other/test.go +++ b/geg/other/test.go @@ -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) + } } -