Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http/httptest: serve flag not read when not running as a test; remove flag in that case? #28619
What version of Go are you using (
If you want to specify an explicit port, there's a whole package for running HTTP servers:
The httptest package is for making it easy to write tests, and in a test you shouldn't need to worry about little details like IPs or port numbers.