Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Go linter errors? #741
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: