If you are using Golangci-lint, you can find this kind of error.
level=error msg="Running error: 1 error occurred:\n\t* can't run linter goanalysis_metalinter: buildir: failed to load package cache: could not load export data: no export data
But how can we resolve it?
Solution
In almost every case, this issue append when the project can't be build correctly. So execute the command go build
to check if you haven't an error elsewhere.
In all cases where I've met this issue, I had a version conflict between two libraries, or a library which was loaded correctly.
Other possibilities
When I had this issue for the first time, I saw a lot of people saying that they had this issue with specific versions of the linter.
So if you still have the error after doing a successful go build
, check if you have the latest version of the tool.
Links
- Golangci-lint - Documentation : https://golangci-lint.run/
- Golangci-lint - Github : https://github.com/golangci/golangci-lint
I hope it willl help you! 🍺
Top comments (0)