[英]How do I run a go test using bazel with the -race option?
In go, I can enable the race detector for tests using the -race
option eg在 go 中,我可以使用
-race
选项启用竞态检测器进行测试,例如
go test -race./foo/bar
How do I do this in bazel?我如何在巴泽尔中做到这一点?
As of https://github.com/bazelbuild/rules_go/pull/635 , you can run bazel tests using the option --features race
to provide the -race
flag to go tests.从https://github.com/bazelbuild/rules_go/pull/635 开始,您可以使用选项
--features race
运行 bazel 测试,为 go 测试提供-race
标志。 eg例如
bazel test --features race //src/foo/bar
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.