-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Go linter errors? #741
Comments
Hi @zmoazeni! Sorry for the late reply. So, I'm ambivalent. Some lint errors are excellent advice. Some are general programming practices (and I understand they can encourage a single, unified practice). Some I plainly disagree with (cyclomatic complexity of this function?). Some are nitpicks for upper/lower case letters ( I confess that I'm not a purist and I do not adhere to each and every What do you think? |
Don't be sorry at all. I get it. I get where you're coming from. It certainly falls down a rabbit hole of tweaking stuff just to tweak stuff with no real gains. Speaking to the variable/package casing, I do think some of the nitpicky stuff helps others that aren't versed in go to feel confident they're "speaking go" instead of coming at it with a different language's "accent", if that makes sense. A linter helps keep them on track. I've noticed that with rubocop and newer Ruby devs. One of my personal nitpicks is the required comment on all public functions/structures. They end up with unhelpful comments that looks like: // MyFunc takes an integer and returns a string
func MyFunc(x int) string {
// ...
} I personally would rather that comment not exist at all. For what it's worth I've seen some good use with https://github.com/golangci/golangci-lint it might check the boxes you're looking for:
My suggestion would be to use a linter but be clear about what things you care about what you don't. Even if it disables everything by default and only enables a handful of useful linters. That said, if you would rather not go down that path, I would respect your decision. |
OK, I'm game to give this a shot! |
Hiya! One of the nice features of Visual Studio Code is that it integrates linters very easily.
Unfortunately, checking a few different linters comes up with a slew of issues in this codebase. I've moved to golangci-lint because it's one of the few that supports Go modules.
Here's a snippet of the issues I'm seeing:
Some questions I have:
The text was updated successfully, but these errors were encountered: