Not sure when Go starts to cache the test results. When I tried to run test with HTTP requests, the results are all the same after successful test. After some Google searches, I found the answer in the reply of the issue . The test caching can be disabled by the following setting:
If you use command line, you can run the following command:
$ export GOCACHE=off
Or add the above command in the Makefile if you use make in your workflow.
Tested on: Ubuntu Linux 17.10, Go 1.10.
|||cmd/dist: no obvious way to disable test caching · Issue #22758 · golang/go · GitHub|