mirror of
https://github.com/golang/go
synced 2024-11-26 20:11:26 -07:00
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: Andrew Bonventre <andybons@golang.org>
This commit is contained in:
parent
acebfba755
commit
1473789b74
@ -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) }
|
||||
|
Loading…
Reference in New Issue
Block a user