"Linting" can be such a vague and confusing term. I want to go over a few of the most common and useful checks that staticcheck lints for, just so you can see a few more examples.
If you're curious, you can see the full list of checks here.
This is the one we've been using so far. It checks for unused variables, functions, and types.
This one is pretty self-explanatory. It checks for invalid Printf calls. For example, if you try to print a string with a %d format specifier, you'll get an error.
Defers in range loops may not run when you expect them to, and in general you should just avoid them.
Before:
for i, x := range src {
dst[i] = x
}
After:
copy(dst, src)