caching - 在 go 1.10 中没有明显的方法来禁用测试缓存

标签 caching go

<分区>

Golang 1.10 引入了测试缓存,但没有明显的方法来禁用测试缓存。 所以问题是,如何暂时禁用它以及如何强制重建它。 我确实阅读了文档:https://golang.org/cmd/go/#hdr-Build_and_test_caching但没有找到该问题的任何明显答案。

最佳答案

绕过测试缓存的惯用方法是使用-count=1。这也是发行说明中推荐的方法

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.

引用:https://golang.org/doc/go1.10#test

关于caching - 在 go 1.10 中没有明显的方法来禁用测试缓存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49998917/

相关文章:

swift - NSMutableURLRequest 的配置,cachePolicy 始终为 ReloadIgnoringLocalAndRemoteCacheData

json - 解码动态 JSON,忽略已知字段

go - 如何延迟函数返回的匿名函数

asp.net - ASP.net 应用程序的内存与缓存

php - Twitter - twemproxy - memcached - 重试未按预期工作

依赖模块的Golang DDD实现

go - 错误检测,选择 channel

go - 如何仅针对更改的模板运行 gogenerate?

ios - 如何设置 NSURLRequest 缓存过期?

asp.net - ASP.Net 缓存故障排除 - CacheDuration 属性似乎没有效果