That is why (and most likely it happens in Windows, right?).
You can try to improve the situation somewhat, according to this part of the documentation go help test
:
The test files "_test" will be a test binary.
Simply put, you can make all your tests a separate package (for example, all_test
) or packages (for example, for the internal package foo
make the package foo_test
) and make it go install
. The next run, go test ./...
, will "pick up" these packages from $GOPATH/pkg
without compiling.
On the other hand, the synthesis of a temporary binary will be performed all the same for testing and linking these packages to it. Therefore, if there are few tests, this method may not improve the situation.
Therefore, perhaps the only way is to speed up the build (put $GOPATH
on an SSD, for example) or, if possible, use something more basic for basic development (a system based on GNU / Linux or * BSD or Mac OS), and on Windows "final" testing before building for a binary release.