FAQ
LGTM.

More and more I wish there was a finaliser on res.Body() that panic'd
if it wasn't closed.
On Sat, Nov 3, 2012 at 1:27 AM, wrote:
Reviewers: golang-dev_googlegroups.com,

Message:
Hello golang-dev@googlegroups.com,

I'd like you to review this change to
https://dvyukov%40google.com@code.google.com/p/go/


Description:
net/http: fix data race in test
The issue is that server still sends body,
when client closes the fd.
Fixes issue 4329.

Please review this at http://codereview.appspot.com/6822072/

Affected files:
M src/pkg/net/http/fs_test.go


Index: src/pkg/net/http/fs_test.go
===================================================================
--- a/src/pkg/net/http/fs_test.go
+++ b/src/pkg/net/http/fs_test.go
@@ -648,6 +648,8 @@
if err != nil {
t.Fatal(err)
}
+ io.Copy(ioutil.Discard, res.Body)
+ res.Body.Close()
if res.StatusCode != tt.wantStatus {
t.Errorf("test %q: status = %d; want %d", testName,
res.StatusCode, tt.wantStatus)
}

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 4 | next ›
Discussion Overview
groupgolang-dev @
categoriesgo
postedNov 2, '12 at 2:27p
activeNov 2, '12 at 8:31p
posts4
users3
websitegolang.org

3 users in discussion

Dvyukov: 2 posts Dave Cheney: 1 post Russ Cox: 1 post

People

Translate

site design / logo © 2022 Grokbase