Re:Improving Go code: An introduction to the static analysis...
by ainar-g on Monday November 11, 2019 @02:18AM
(#21502838)
Staticcheck is inavluable, and I support it with words, actions, and
money. Here are some additional tools that you might want to have in
your module's tools.go:
* github.com/kisielk/errcheck[1]: Find cases where you (accidentally?)
ignore errors.
* github.com/gordonklaus/ineffassign[2]: Find ineffectial assignments;
sounds simple, almost unneeded, but in my practice it's actually one
of the most effective analyses to find actual bugs.
* mvdan.cc/unparam[3]: Find functions that always consume or return one
value; great for refactorings.
* github.com/kisielk/errcheck[1]: Find cases where you (accidentally?) ignore errors.
* github.com/gordonklaus/ineffassign[2]: Find ineffectial assignments; sounds simple, almost unneeded, but in my practice it's actually one of the most effective analyses to find actual bugs.
* mvdan.cc/unparam[3]: Find functions that always consume or return one value; great for refactorings.
[1] https://github.com/kisielk/errcheck
[2] https://github.com/gordonklaus/ineffassign
[3] https://github.com/mvdan/unparam