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

layer go: add support for golangci-lint #10825

Closed
utrack opened this issue Jun 7, 2018 · 6 comments
Closed

layer go: add support for golangci-lint #10825

utrack opened this issue Jun 7, 2018 · 6 comments
Labels

Comments

@utrack
Copy link

utrack commented Jun 7, 2018

Go layer has support for gometalinter, but it has no switch to use golangci-lint (https://github.com/golangci/golangci-lint) instead.
Flycheck already has package flycheck-golangci-lint.

@panchoh
Copy link
Contributor

panchoh commented Sep 4, 2019

This issue was fixed a long time ago in develop (see referenced PR above), so I think it should be closed.

@duianto
Copy link
Contributor

duianto commented Sep 7, 2019

@panchoh Your right, thanks.

@dbriemann
Copy link

Sorry to hijack this but I think my question is related to this feature. I configured my spacemacs to use the golangci-lint. Now I have the problem, that compiler errors are not correctly shown. If I have no compile errors, the linter works correctly and shows me the linter errors/warnings on the correct lines.

Do I need to set the go-build linter before the golangci-lint linter? Is that possible? Or is there another recommended way to highlight build errors correctly before using the linter? If I set the linter to lsp-ui, build errors are also shown correctly, but is worse than golangci-lint.

p.s.
I am on the current develop branch.

@seriousben
Copy link

I see the same behavior as @dbriemann

@seriousben
Copy link

Using an official way of installing golangci-lint (https://github.com/golangci/golangci-lint#install) seems to work for me now.

$ golangci-lint version
golangci-lint has version 1.20.1 built from 849044b on 2019-10-15T19:11:27Z

duianto pushed a commit that referenced this issue Dec 28, 2019
See #10825.

Try to match more closely the build process followed upstream:

- Force module build mode, which builds the latest stable release (not master),
and takes care of module replacements.

- Disable cgo.

- The -trimpath argument to go get requires go >= 1.13, which is also needed
because go <= 1.12 has a bug that causes problems with golangci-lint², as
explained in the golangci-lint installation instructions².

Note that the only thing that is missing to exactly match the upstream build
process is the addition of some -X variables, which only affect the data
reported by golangci-lint version.

¹: golang/go#29612
²: https://github.com/golangci/golangci-lint#install

Thanks to @dbriemann and @seriousben for reporting and clarifying this issue!
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants