我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何使用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?

-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.

近期文章

  • 应该使用基于例程/通道的机制替换并发映射吗?
  • 习惯用法比较2个切片以查看已删除哪个元素
  • 收到长度为20527的net / http GET请求错误tls超大记录
  • 如何在双向链接列表中获取元素值的指针(go-lang)
  • fmt软件包的功能是否支持数组的格式化程序?
  • 为什么此Go程序的websocket连接建立失败?
  • os.OpenFile权限问题测试
  • 清除临时文件的最佳方法
  • 解决Go中重复的互斥锁
  • 如何使用gccgo构建静态程序
  • 如何定义const * DataType
  • 在Codenvy环境上运行Go Server
  • 获取特定xml字段的所有值
  • 与软件包共享数据库连接
  • App Script Go快速入门修改401错误
  • 如何将正有符号的int32值转换为其负值?
  • 在Golang中将多部分文件转换为图像对象
  • 从net.CIDRMask获取ipv6子网掩码
  • 从Windows获得全名的最佳方法是什么?
  • 分析go程序时索引超出范围错误

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华