Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

gocov with coverprofile raise error, the file path contains duplicate parts #97

Open
maxin93 opened this issue Dec 30, 2022 · 1 comment

Comments

@maxin93
Copy link

maxin93 commented Dec 30, 2022

I have got the kubernetes coverprofile with make test, I want to convert the profile to html with gocov-html, but when I run gocov to convert the combined-coverage.out to json format under the dir of /opt/zz/kubernetes which is the source root of my code, it raise the following error messages:
error: open /opt/zz/kubernetes/vendor/k8s.io/kubernetes/vendor/k8s.io/api/core/v1/generated.pb.go: no such file or directory unmarshal coverage data: unexpected end of JSON input

I found that the file exist, but the path with duplicate parts, the exist file path is /opt/zz/kubernetes/vendor/k8s.io/api/core/v1/generated.pb.go, I guess that there must be some misconfiguration, can anyone help me?
image

@axw
Copy link
Owner

axw commented Jan 9, 2023

I guess gocov has a problem with vendored code.

Have you considered using go tool cover -html instead?

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

No branches or pull requests

2 participants