Is there a static analysis tool for Go language –like lint
, pylint
etc? As far as I googled, I haven't found anything related.
I may do this as an undergrad senior project in my department. I must be sure that it is not done before. Any help is appreciated.
Golint is newly released this week: https://github.com/golang/lint
Here are three related tools that you might want to look at. You will see how to parse and analyze Go source code.
In the latest version of go (1.3) godoc includes some static analysis features:
There are a whole bunch of linters with varying types of output. Some include column offsets, some don't include any context, etc.
I've written a tool called gometalinter that installs, runs and normalises the output of all the ones I'm aware of:
If there are any linters missing I'd love to add them.
There's also a SublimeLinter plugin for it.
If you want a quick look at the state of your entire Go project, ie with various static analysis tools:
You can check out:
(from http://gophergala.com)
It will check for any issue reported by those four tools in your GitHub repo.
Try megacheck.
megacheck runs staticcheck, gosimple and unused at once. Because it is able to reuse work, it will be faster than running each tool separately.
Visual Studio Code with Go plugin has the support of this linting tool. To enable it, please navigate to Visual Studio Settings and set go.lintTool property to megacheck.
{
"go.lintTool": "megacheck"
}