gpt4 book ai didi

go - 以编程方式获取 golang 覆盖率

转载 作者:IT王子 更新时间:2023-10-29 01:14:55 27 4
gpt4 key购买 nike

go -cover 或 -coverprofile 在运行 go 测试时非常有用,并且可以在 html 或纯文本中很好地显示。但是是否有 api 以编程方式访问它或处理文件?

最佳答案

你可以试试axw/gocov ,其中:

您可以看到类似 GoCov GUI 的工具在 convert_statements(s []*gocov.Statement, offset int) 中使用 gocov.Statement为了构建一个小型 GUI:

https://camo.githubusercontent.com/c7865d70f68bcf9ba8a8d82cf40e75b254301be6/687474703a2f2f6e6f736d696c65666163652e72752f696d616765732f676f636f766775692e706e67

关于go - 以编程方式获取 golang 覆盖率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24644823/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com