mirror of
https://github.com/golang/go
synced 2024-11-20 00:24:43 -07:00
net/http, net/http/httputil: fix nits found by vet
Change-Id: Idf02428591f61dc58f654fdaf0e3a55f8b8a1060 Reviewed-on: https://go-review.googlesource.com/18350 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
4aedbf5be4
commit
c063e342f8
@ -392,7 +392,7 @@ func TestReverseProxy_Post(t *testing.T) {
|
|||||||
backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
slurp, err := ioutil.ReadAll(r.Body)
|
slurp, err := ioutil.ReadAll(r.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("Backend body read = %v", err)
|
t.Errorf("Backend body read = %v", err)
|
||||||
}
|
}
|
||||||
if len(slurp) != len(requestBody) {
|
if len(slurp) != len(requestBody) {
|
||||||
t.Errorf("Backend read %d request body bytes; want %d", len(slurp), len(requestBody))
|
t.Errorf("Backend read %d request body bytes; want %d", len(slurp), len(requestBody))
|
||||||
|
@ -1077,7 +1077,7 @@ Try:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !ok {
|
if !ok {
|
||||||
t.Fatal("Failed to start up after %d tries", maxTries)
|
t.Fatalf("Failed to start up after %d tries", maxTries)
|
||||||
}
|
}
|
||||||
defer ln.Close()
|
defer ln.Close()
|
||||||
c, err := tls.Dial("tcp", ln.Addr().String(), &tls.Config{
|
c, err := tls.Dial("tcp", ln.Addr().String(), &tls.Config{
|
||||||
@ -2496,7 +2496,7 @@ func TestHijackBeforeRequestBodyRead(t *testing.T) {
|
|||||||
gone := w.(CloseNotifier).CloseNotify()
|
gone := w.(CloseNotifier).CloseNotify()
|
||||||
slurp, err := ioutil.ReadAll(reqBody)
|
slurp, err := ioutil.ReadAll(reqBody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("Body read: %v", err)
|
t.Errorf("Body read: %v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(slurp) != len(requestBody) {
|
if len(slurp) != len(requestBody) {
|
||||||
|
Loading…
Reference in New Issue
Block a user