duan32342 2016-01-24 22:05
浏览 35
已采纳

如何使用gb获得代码覆盖率?

Running gb:

gb test .../<regex>/... -v

works, but running gb test .../<regex>/... -coverprofile=cover.out results in:

testing: cannot use -test.coverprofile because test binary was not built with coverage enabled

while go test -coverprofile cover.out works. How to get code coverage using gb as well?

  • 写回答

1条回答 默认 最新

  • doushenmao9036 2016-01-25 10:28
    关注

    -coverprofile flag is not supported in gb yet.

    You can check the status at https://github.com/constabulary/gb/issues/367.

    There is also a workaround posted there, which you can use.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 ansys fluent计算闪退
  • ¥15 有关wireshark抓包的问题
  • ¥15 Ubuntu20.04无法连接GitHub
  • ¥15 需要写计算过程,不要写代码,求解答,数据都在图上
  • ¥15 向数据表用newid方式插入GUID问题
  • ¥15 multisim电路设计
  • ¥20 用keil,写代码解决两个问题,用库函数
  • ¥50 ID中开关量采样信号通道、以及程序流程的设计
  • ¥15 U-Mamba/nnunetv2固定随机数种子
  • ¥30 C++行情软件的tick数据如何高效的合成K线