1
0
mirror of https://github.com/golang/go synced 2024-11-21 22:04:39 -07:00

dont block on httptest.Server.Start when serveFlag is present

The presence of the `httptest.serve=<addr>` flag seems to switch the expectation of how the `httptest.Server.Start()` works since it is currently blocking after printing the url.

Unless I am missing something, we don't really need that blocking `select {}` after the print.
This commit is contained in:
Urjit Singh Bhatia 2024-06-21 18:02:29 -07:00 committed by GitHub
parent 44f1870666
commit b0f937a19e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -134,7 +134,6 @@ func (s *Server) Start() {
s.goServe() s.goServe()
if serveFlag != "" { if serveFlag != "" {
fmt.Fprintln(os.Stderr, "httptest: serving on", s.URL) fmt.Fprintln(os.Stderr, "httptest: serving on", s.URL)
select {}
} }
} }