Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: go test quietly skips test if custom flag is defined #36527
What version of Go are you using (
This is working as intended, though the behavior is a bit confusing.
I think the fix for this would mean reporting an error if an unrecognized flag is not preceded by explicit package arguments. That would be a breaking change, and commands like
cc @bcmills who spent some time looking at test flags recently.
This could possibly be a bug in `go test` command golang/go#36527 . The `go test` command would skip tests in sub-packages if the top-level package has a `custom flag` defined and the sub-packages don't define it. Issue golang/go#36527 (comment) has an example of this. This PR also removes the code from the test that would unnecessary start a web server. I see two problems here 1. An unnecessary web server running. 2. We cannot run multiple tests are the same time since the second run of the test would try to start a web server and crash saying `port already in use`.