Description
Proposal Details
go test -c
currently produces one test binary per package listed. When running without -c
, go test will run all tests for all packages listed. I propose that go test -c
mirror that behavior when compiling a test binary, and produce a single a.out
that when executed does exactly the same thing as running go test
directly without the -c
flag.
The reason that I think this is a good idea is because this behavior would reduce the disparity between using the -c
and not using it. Concretely, this would make it easier to build and share test executables to run in a single command. I have a concrete use case for this where we run integration tests in a container that's built on build machines. Enabling this would reduce the image size transferred back and forth :)