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

Support golangci-linter #257

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Support golangci-linter #257

wants to merge 5 commits into from

Conversation

lcd1232
Copy link

@lcd1232 lcd1232 commented Jun 10, 2023

  • Adds support golangci-linter in CI/CD and locally (pre-commit run --all-files)
  • Fixes some linter warnings (not all of them since I don't know how it should work)

@probonopd
Copy link
Owner

Thanks @lcd1232

Getting


Error: ../internal/helpers/appdir.go:157:16: undefined: errors.Join
Error: ../internal/helpers/appdir.go:177:16: undefined: errors.Join
note: module requires Go 1.20
Error: Process completed with exit code 2.

Do you know what is going on there?

@lcd1232
Copy link
Author

lcd1232 commented Jun 18, 2023

@probonopd it seems like you have go version lower than go1.20. Could you check what's your version using go version?

@probonopd
Copy link
Owner

Isn't this where you set it?

go-version: '^1.20.x'

with:
go-version: 1.18
go-version: '^1.20.x'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's already required in go.mod

@probonopd
Copy link
Owner

Thank you very much.
Looks like it is working as intended now?

@CalebQ42 how do you like this?

@CalebQ42
Copy link
Contributor

Ultimately I think having a consistent linter strategy is a good thing, but I'm not sure golangci-linter is a good choice. It doesn't seem to provides any tangible benefits vs using a single linter. I personally have been using staticcheck since it's the default for VS Code and golangci-linter didn't seem to catch anything new in this project or any of my other projects. Additionally on golangci-linter's own website it says it includes staticcheck even though it's author is against it, which turns me off enough that I personally won't be using it in my personal projects.

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

Successfully merging this pull request may close these issues.

3 participants