Skip to content

Commit f5ec2e4

Browse files
ZekeLuneild
authored andcommitted
net/http/httptest: remove unnecessary creation of http.Transport
In (*Server).StartTLS, it's unnecessary to create an http.Client with a Transport, because a new one will be created with the TLSClientConfig later. Change-Id: I086e28717e9739787529006c3f0296c8224cd790 GitHub-Last-Rev: 3372459 GitHub-Pull-Request: golang#60124 Reviewed-on: https://go-review.googlesource.com/c/go/+/494355 Run-TryBot: t hepudds <thepudds1460@gmail.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: qiulaidongfeng <2645477756@qq.com>
1 parent be26ae1 commit f5ec2e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/net/http/httptest/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func (s *Server) StartTLS() {
144144
panic("Server already started")
145145
}
146146
if s.client == nil {
147-
s.client = &http.Client{Transport: &http.Transport{}}
147+
s.client = &http.Client{}
148148
}
149149
cert, err := tls.X509KeyPair(testcert.LocalhostCert, testcert.LocalhostKey)
150150
if err != nil {

0 commit comments

Comments
 (0)