Commit 1473789b authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

net/http: remove stderr log spam in test

Fixes #24831

Change-Id: Icd39093d1b7d9b25aa8374c0298cdb1dea48e672
Reviewed-on: https://go-review.googlesource.com/107817
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarAndrew Bonventre <andybons@golang.org>
parent acebfba7
......@@ -3731,6 +3731,10 @@ func TestTransportEventTraceTLSVerify(t *testing.T) {
t.Error("Unexpected request")
}))
defer ts.Close()
ts.Config.ErrorLog = log.New(funcWriter(func(p []byte) (int, error) {
logf("%s", p)
return len(p), nil
}), "", 0)
certpool := x509.NewCertPool()
certpool.AddCert(ts.Certificate())
......@@ -4424,3 +4428,7 @@ func TestNoBodyOnChunked304Response(t *testing.T) {
t.Errorf("Unexpected body on 304 response")
}
}
type funcWriter func([]byte) (int, error)
func (f funcWriter) Write(p []byte) (int, error) { return f(p) }
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