Golang 1.10 introduced caching for test, but there is no obvious way to disable test caching. So the question is, how to temporal dislable it and how to force rebuild it. I did read the documentation: https://golang.org/cmd/go/#hdr-Build_and_test_caching but did not found any obvious answer to that question.
The idiomatic way to bypass test caching is to use -count=1. This is the recommended way for doing that in release note as well
The go test command now caches test results: if the test executable and command line match a previous run and the files and environment variables consulted by that run have not changed either, go test will print the previous test output, replacing the elapsed time with the string “(cached).” Test caching applies only to successful test results; only to go test commands with an explicit list of packages; and only to command lines using a subset of the -cpu, -list, -parallel, -run, -short, and -v test flags. The idiomatic way to bypass test caching is to use -count=1.
Refer : https://golang.org/doc/go1.10#test
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With