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

Running error: context loading failed: package github.com/golangci/golangci-lint/pkg/commands: no go files to analyze #916

Closed
3 tasks done
Anjana-Prabhakar opened this issue Jan 10, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@Anjana-Prabhakar
Copy link

Anjana-Prabhakar commented Jan 10, 2020

Thank you for creating the issue!

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Please include the following information:

Version of golangci-lint ```console $ golangci-lint --version golangci-lint has version (devel) built from (unknown, mod sum: "") on (unknown) ```
Config file
$ cat .golangci.yml
linters:
  disable-all: true
  enable:
    - unused
linters-settings:
  unused:
    check-exported: true
Go environment
$ go version && go env
# paste output here
Verbose output of running
$ golangci-lint run -v
# paste output here
i get an error "Running error: context loading failed: package github.com/golangci/golangci-lint/pkg/commands: no go files to analyze" even when there are go files in the location.
@tpounds tpounds added the bug Something isn't working label Jan 12, 2020
@Dominik-K
Copy link
Contributor

@Anjana-Prabhakar: What's the output when adding the environment variables GL_DEBUG=linters_output GOPACKAGESPRINTGOLISTERRORS=1?

@Anjana-Prabhakar
Copy link
Author

@Dominik-K Thanks for the response. I added the variables to .bashrc. The error remains the same though.

@Dominik-K
Copy link
Contributor

@Anjana-Prabhakar There should be more output now. Can you paste it here, please?

@Anjana-Prabhakar
Copy link
Author

@Dominik-K I am sorry but its still the same one line error that i get.
Is it sufficient that I add the lines

export GL_DEBUG=linters_output 
export GOPACKAGESPRINTGOLISTERRORS=1

to ~/.bashrc , followed by the command
source ~/.bashrc

@Dominik-K
Copy link
Contributor

@Anjana-Prabhakar Yes, that should be sufficient. You can also add these environments before the golangci-lint command.

@fdcds
Copy link

fdcds commented Feb 13, 2020

Probably a duplicate of #825.

@jirfag
Copy link
Member

jirfag commented May 18, 2020

Duplicate of #825

@jirfag jirfag marked this as a duplicate of #825 May 18, 2020
@jirfag jirfag closed this as completed May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants