go-nyet
go-nyet copied to clipboard
Not a superset of "go vet"
I'm not sure if this is intentional, but go-nyet doesn't pick up some issues that go vet does. eg.
devtodo2$ go vet .
importer.go:29: possible formatting directive in fatal call
importer.go:39: possible formatting directive in fatal call
main.go:115: possible formatting directive in fatal call
main.go:126: possible formatting directive in fatal call
main.go:174: possible formatting directive in fatal call
main.go:189: possible formatting directive in fatal call
main.go:237: possible formatting directive in fatal call
main.go:284: possible formatting directive in fatal call
main.go:288: possible formatting directive in fatal call
main.go:336: possible formatting directive in fatal call
exit status 1
devtodo2$ go-nyet .
consoleview.go:67:2:Odd decl (const, import, or type) in body
This is not a big deal, but it does also seem to include some checks that are the same for both, so if you run both tools you sometimes get duplicates.
Basically I'd like to run either both of them, or just one of them, get the same coverage, and not get duplicates.
Fair point -- I've imagined that you run both of them and they catch different things.
The error you've pointed to here is really just a debugging message and not an error, so I should fix that for sure.
Hi @barakmich, Thanks for creating this tool!
I think it would be nice if go-nyet would be usable as a superset of go-vet directly, in the same way goimports
and goreturns
are for gofmt
. What would be required for this is:
- Add support for the
-n
and-x
flags - Consistent output (
file.go:123: lower case error message
) - Run go-vet with same parameters
- Optionally: Run
go vet
for each package seperately and buffer all lines for bothgo vet
andgo-nyet
and sort alphabetically (could also remove duplicates at this stage).
- Optionally: Run
This would make go-nyet a hot-plugable alternative in IDE's. In the same way as goimports
and goreturns
currently are. For instance in the atom go-plus plugin.