Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

重命名的文件,会被merge一起 #374

Open
HeartIsBeat opened this issue Apr 28, 2024 · 2 comments
Open

重命名的文件,会被merge一起 #374

HeartIsBeat opened this issue Apr 28, 2024 · 2 comments

Comments

@HeartIsBeat
Copy link

HeartIsBeat commented Apr 28, 2024

当前环境,有个文件名为A,获取了一次覆盖率文件,名为:a.cov
后来将这个A文件改名为B,再次获取覆盖率文件,名为b.cov

使用goc merge将a和b文件merge一起为m.cov,结果m.cov文件中包含了A和B文件的覆盖率情况。
(很明显,A文件并不是我想要的覆盖率文件)

这种大家怎么处理的?

@CarlJi
Copy link
Collaborator

CarlJi commented Apr 28, 2024

这是因为go语言的覆盖率收集本质是基于语句的,也就是实际的代码,跟文件名没有关系.

基于你的例子,如果你是想清理特定时候之前的覆盖率结果,可以考虑使用goc clear 命令

@HeartIsBeat
Copy link
Author

@CarlJi 我是每天拉一次覆盖率数据,到迭代结束后,才会goc clear清理覆盖率;这样子,每天拉的数据,难保会有重命名文件的情况,这就直接导致整个覆盖率转不了html了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants