Commit 27b98974 authored by Mikio Hara's avatar Mikio Hara Committed by Brad Fitzpatrick

net/http: fix nits found by go tool vet

LGTM=ruiu
R=golang-codereviews, ruiu
CC=golang-codereviews
https://golang.org/cl/91480043
parent f5184d34
...@@ -2144,7 +2144,7 @@ func TestCodesPreventingContentTypeAndBody(t *testing.T) { ...@@ -2144,7 +2144,7 @@ func TestCodesPreventingContentTypeAndBody(t *testing.T) {
got := ht.rawResponse(req) got := ht.rawResponse(req)
wantStatus := fmt.Sprintf("%d %s", code, StatusText(code)) wantStatus := fmt.Sprintf("%d %s", code, StatusText(code))
if !strings.Contains(got, wantStatus) { if !strings.Contains(got, wantStatus) {
t.Errorf("Code %d: Wanted %q Modified for %q: %s", code, req, got) t.Errorf("Code %d: Wanted %q Modified for %q: %s", code, wantStatus, req, got)
} else if strings.Contains(got, "Content-Length") { } else if strings.Contains(got, "Content-Length") {
t.Errorf("Code %d: Got a Content-Length from %q: %s", code, req, got) t.Errorf("Code %d: Got a Content-Length from %q: %s", code, req, got)
} else if strings.Contains(got, "stuff") { } else if strings.Contains(got, "stuff") {
......
...@@ -2081,7 +2081,7 @@ func TestTransportClosesBodyOnError(t *testing.T) { ...@@ -2081,7 +2081,7 @@ func TestTransportClosesBodyOnError(t *testing.T) {
defer res.Body.Close() defer res.Body.Close()
} }
if err == nil || !strings.Contains(err.Error(), fakeErr.Error()) { if err == nil || !strings.Contains(err.Error(), fakeErr.Error()) {
t.Fatalf("Do error = %v; want something containing %q", fakeErr.Error()) t.Fatalf("Do error = %v; want something containing %q", err, fakeErr.Error())
} }
select { select {
case err := <-readBody: case err := <-readBody:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment