Join GitHub today
GitHub is home to over 28 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 (
changed the title from
httptest.serve flag not read
net/http/httptest: serve flag not read when not running as a test; remove flag in that case?
Nov 6, 2018
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.