alecthomas / gometalinter

DEPRECATED: Use https://github.com/golangci/golangci-lint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

vet is marked as "fast", but it's not fast

JeanMertz opened this issue · comments

I've got a small'ish file with some garbage lines in it:

$ wc -l main.go
     444 main.go

Running this with --fast still takes ~5 seconds:

$ time gometalinter --fast main.go
main.go:93:68:error: expected ';', found 'IDENT' asd (gotype)
main.go:93:68:error: expected ';', found 'IDENT' asd (gotypex)
main.go:93:68:warning: expected ';', found 'IDENT' asd (golint)
main.go:93:68:error: syntax error: unexpected asd at end of statement (vet)
main.go:93:68:warning: syntax error: unexpected asd at end of statement (vetshadow)
        5.26 real        15.38 user         5.08 sys

After going through the "fast" linters one by one, I found vet (and vetshadow) to be the cause:

$ time gometalinter --disable-all --enable=vet main.go 
main.go:93:68:error: syntax error: unexpected asd at end of statement (vet)
        4.39 real         6.93 user         2.12 sys
$ time gometalinter --disable-all --enable=vetshadow main.go 
main.go:93:68:warning: syntax error: unexpected asd at end of statement (vetshadow)
        4.44 real         6.84 user         2.06 sys

I suggest not marking vet and vetshadow as fast, unless there's actually a bug that's causing it to be so slow...

Hmm, I now realise I think this is because vet require's a go build, which is rather slow for this project, probably because there are some cgo dependencies.

I'll close this issue, feel free to re-open if this is still a problem you want to tackle.