启用-race在编译的二进制文件上。

huangapple go评论76阅读模式
英文:

Enable -race on compiled binary

问题

我正在尝试启用竞争检测器:https://go.dev/doc/articles/race_detector

由于我无法将源代码上传到测试服务器,我该如何启用-race或编译启用了-race的二进制文件呢?

英文:

I'm trying to enable the race detector: https://go.dev/doc/articles/race_detector

Since I can't upload the source code to the test server, how can I enable -race or compile a binary with -race enabled?

答案1

得分: 4

请将以下内容翻译为中文:

在你现在构建的过程中,根据你在问题中提供的链接中所述,添加-race选项。

例如,

go build -race main.go
英文:

Add -race to however you're building now, as stated in the document you've linked to in your question.

For example,

go build -race main.go

huangapple
  • 本文由 发表于 2021年12月2日 12:11:12
  • 转载请务必保留本文链接:https://go.coder-hub.com/70194102.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定