1
0
mirror of https://github.com/golang/go synced 2024-10-01 10:28:31 -06:00

net/http: fixed trivial go vet warnings

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>
This commit is contained in:
Emmanuel Odeke 2016-04-07 19:59:59 -07:00 committed by Brad Fitzpatrick
parent 68ac1f7746
commit 853f1a1a63
2 changed files with 3 additions and 3 deletions

View 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)

View 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) {