]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: eliminate defined-but-not-used var.
authorAlan Donovan <adonovan@google.com>
Tue, 11 Mar 2014 02:22:51 +0000 (22:22 -0400)
committerAlan Donovan <adonovan@google.com>
Tue, 11 Mar 2014 02:22:51 +0000 (22:22 -0400)
gc does not report this as an error, but go/types does.
(I suspect that constructing a closure counts as a reference
to &all in gc's implementation).

This is not a tool bug, since the spec doesn't require
implementations to implement this check, but it does
illustrate that dialect variations are always a nuisance.

LGTM=rsc, bradfitz
R=bradfitz
CC=golang-codereviews, gri, rsc
https://golang.org/cl/73850043

src/pkg/net/http/client_test.go

index 1f8a8b12cfae3848f6e084f6936f71314777c0d8..7f1c4b13928c703ec07f35054249fc680687cf3d 100644 (file)
@@ -886,11 +886,9 @@ func TestClientTimeout(t *testing.T) {
                t.Fatal("handler never got /slow request")
        }
 
-       var all []byte
        errc := make(chan error, 1)
        go func() {
-               var err error
-               all, err = ioutil.ReadAll(res.Body)
+               _, err := ioutil.ReadAll(res.Body)
                errc <- err
                res.Body.Close()
        }()