将多个包中的Go测试构建为单个文件。

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

Building go tests from multiple packages into single file

问题

有没有办法将位于多个包内的项目中的所有测试文件构建成一个单独的二进制文件?
要在单个包内构建二进制文件,可以使用go test -c命令。
我需要像go test ./... -c这样的功能,但是它返回“无法在多个包中使用-c标志”。

英文:

Is there any way to build all the test files in a project located inside multiple packages into a single binary file?
To build binary inside a single package, I could use
go test -c.

I need something like go test ./... -c,but this returns "cannot use -c flag with multiple packages"

答案1

得分: 1

有没有办法将位于多个包内的项目中的所有测试文件构建成一个单独的二进制文件?

英文:

> Is there any way to build all the test files in a project located inside multiple packages into a single binary file?

No.

huangapple
  • 本文由 发表于 2022年6月27日 19:05:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/72771065.html
匿名

发表评论

匿名网友

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

确定