Skip to content

Errors with example config when editing non-go files in directories without go files #3

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

Open
vitaminmoo opened this issue Mar 19, 2025 · 2 comments

Comments

@vitaminmoo
Copy link

With the example config, every non-go file in a dir without go files gets an error on character 1:

ERRO Running error: context loading failed: no go files to analyze: running `go mod tidy` may solve the problem

This is the same error as running golangci-lint run --out-format json --issues-exit-code=1 in a dir with no go files. I don't see any CLI flags on golangci-lint to make it not print this error.

@lukasmalkmus
Copy link

Same here: level=error msg="Running error: context loading failed: failed to load packages: failed to load packages: package github.com/<redacted>: no go files to analyze"

So I believe it just shouldn't run if there are no go files in the current scope?

@maxekman
Copy link

I submitted a fix for this to the language server: nametake/golangci-lint-langserver#55

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

3 participants