]> Cypherpunks.ru repositories - gostls13.git/commitdiff
net/http: fixed trivial go vet warnings
authorEmmanuel Odeke <emm.odeke@gmail.com>
Fri, 8 Apr 2016 02:59:59 +0000 (19:59 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 8 Apr 2016 04:53:16 +0000 (04:53 +0000)
Updates #15177

Change-Id: I748f025461f313b5b426821ead695f90d3011a6b
Reviewed-on: https://go-review.googlesource.com/21677
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/net/http/client_test.go
src/net/http/httptest/httptest_test.go

index b9e17c52709bba2593ec8245e8179678191ab4b6..a9b30b1bf5c1347a25c5deb87fb99aa0a217c2fc 100644 (file)
@@ -311,7 +311,7 @@ func TestClientRedirectContext(t *testing.T) {
        _, err := c.Do(req)
        ue, ok := err.(*url.Error)
        if !ok {
-               t.Fatalf("got error %T; want *url.Error")
+               t.Fatalf("got error %T; want *url.Error", err)
        }
        if ue.Err != ExportErrRequestCanceled && ue.Err != ExportErrRequestCanceledConn {
                t.Errorf("url.Error.Err = %v; want errRequestCanceled or errRequestCanceledConn", ue.Err)
index 18ba73880eb8af09122b0f48f36ead7ad7202655..4f9ecbd8bbc465b36aa6037601288f27edb5b602 100644 (file)
@@ -155,10 +155,10 @@ func TestNewRequest(t *testing.T) {
                got := NewRequest(tt.method, tt.uri, tt.body)
                slurp, err := ioutil.ReadAll(got.Body)
                if err != nil {
-                       t.Errorf("%i. ReadAll: %v", i, err)
+                       t.Errorf("%d. ReadAll: %v", i, err)
                }
                if string(slurp) != tt.wantBody {
-                       t.Errorf("%i. Body = %q; want %q", i, slurp, tt.wantBody)
+                       t.Errorf("%d. Body = %q; want %q", i, slurp, tt.wantBody)
                }
                got.Body = nil // before DeepEqual
                if !reflect.DeepEqual(got.URL, tt.want.URL) {