Closed acgreek closed 1 year ago
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.
Hello,
can you provide a minimal reproducible example?
buildssa
is related to something shared between linters (linters are not plugins) so we detected which linter is affected by something like that. The SSA analysis is done only when at least one linter uses SSA.
Note: I recommend updating your go version to at least go1.19.
Unfortunately, I don't see how I can provide you a useful example given that my companies code is not public domain and my change that resulted in finding this issue is massive
So I'm sorry, but without a reproducible example, as the error doesn't contain any information, I'm not able to diagnose or fix your problem.
ok, when I have some free time. I'll see what I can do
I'm having exactly the same error message since today. We use Go 1.17 and golangci-lint 1.45. What is an export data?
evel=error msg="Running error: 1 error occurred:\n\t* can't run linter goanalysis_metalinter: buildir: failed to load package mapper: could not load export data: no export data for \"xxx.com/pkg/mapper\"
found the problem, it is the same as #3391, that folder has compilation errors, the code must compile for golangci-lint to work properly.
Fixed by #3591
I have this problem when i use goland file watcher,but if i input command in terminal it works fine.i don't know what to do to solve this problem. my goland version is 2023.1 golangci-lint version is 1.52.2 here is my log
level=info msg="[config_reader] Config search paths: [./ D:\\workspace\\go\\goframe D:\\workspace\\go D:\\workspace D:\\ C:\\Users\\admin]"
level=info msg="[config_reader] Used config file .golangci.yml"
level=info msg="[lintersdb] Active 11 linters: [contextcheck errorlint ginkgolinter gocheckcompilerdirectives gofmt goimports gosec ineffassign lll nilerr wsl]"
level=info msg="[loader] Go packages loading at mode 575 (exports_file|name|compiled_files|deps|files|imports|types_sizes) took 1.3544023s"
level=info msg="[runner/filename_unadjuster] Pre-built 0 adjustments in 628.3µs"
level=info msg="[linters_context/goanalysis] analyzers took 0s with top 10 stages: contextcheck: 0s, gosec: 0s, gocheckcompilerdirectives: 0s, gofmt: 0s, errorlint: 0s, goimports: 0s, nilerr: 0s, buildssa: 0s, ginkgolinter: 0s, ineffassign: 0s"
level=warning msg="[runner] Can't run linter goanalysis_metalinter: buildssa: failed to load package context: could not load export data: no export data for \"context\""
level=info msg="[runner] processing took 0s with stages: fixer: 0s, path_prefixer: 0s, skip_dirs: 0s, uniq_by_line: 0s, diff: 0s, max_from_linter: 0s, path_shortener: 0s, severity-rules-case-sensitive: 0s, path_prettifier: 0s, exclude-rules: 0s, nolint: 0s, max_same_issues: 0s, max_per_file_from_linter: 0s, cgo: 0s, autogenerated_exclude: 0s, identifier_marker: 0s, exclude: 0s, filename_unadjuster: 0s, skip_files: 0s, source_code: 0s, sort_results: 0s"
level=info msg="[runner] linters took 907.4508ms with stages: goanalysis_metalinter: 907.4508ms"
level=error msg="Running error: 1 error occurred:\n\t* can't run linter goanalysis_metalinter: buildssa: failed to load package context: could not load export data: no export data for \"context\"\n\n"
level=info msg="Memory: 26 samples, avg is 64.8MB, max is 181.5MB"
level=info msg="Execution took 2.4968215s"
I tried solving this damn problem for 3 hours,i give up now.
Welcome
Description of the problem
I have found similar issues reported, though they are all 'closed' and reading through them I didn't find a solution that worked for me. I was able to find that I could make the issue go-away by disabling the following golangci-lint plugin: govet, megacheck, revive stylecheck, contextcheck, exhaustive
So this is also a feature request that when a plugin fails, it should say which plugin failed. This would save a user like myself from have to disable plugins in blocks until I find all the plugins that don't work. Also the error message is not very useful in saying what is wrong
Version of golangci-lint
Configuration file
Go environment
Verbose output of running
Code example or link to a public repository