-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
govet requires go install to work better #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have a bit more information. I added a manual run of Locally:
CI:
I'm not sure what's going on. These reports are around a variable shadowing a package import, so they are correct. I'm not sure why go vet isn't reporting them either :\ |
hi!
|
I don't know why that would be the case...
|
which version of go do you use? |
I've tried 1.9, 1.9.2, 1.10 and 1.10.2 |
ok, thank you. |
|
It's built by
So it looks like I can only reproduce the warnings when I am using the configuration file AND have cleared the pkg directory...that is truly baffling. |
I just tried it with the curled version 1.6.1 and I can reproduce it:
|
in environment where you've reproduced it run, please:
|
Got it. For go version < 1.10 we need to manually I have 3 choices how to fix it:
I can't guarantee that fix will be in a near future. The fastest solution now is to run |
Are you sure that analysis is correct? The example below shows that it reports correctly when there are no compiled artifacts. That seems like the opposite of what you've determined? Or perhaps it's that it only analyses while it's building, and it's already built it skips it?
|
It's also very odd that |
analysis by // Don't complain if the types differ: that implies the programmer really wants two different things.
if types.Identical(obj.Type(), shadowed.Type()) {
f.Badf(ident.Pos(), "declaration of %q shadows declaration at %s", obj.Name(), f.loc(shadowed.Pos()))
} In your case |
1. Allow govet to work in 2 modes: fast and slow. Default is slow. In fast mode golangci-lint runs `go install -i` and `go test -i` for analyzed packages. But it's fast only when: - go >= 1.10 - it's repeated run or $GOPATH/pkg or `go env GOCACHE` is cached between CI builds In slow mode we load program from source code like for another linters and do it only once for all linters. 3. Patch govet code to warn about any troubles with the type information. Default behaviour of govet was to hide such warnings. Fail analysis if there are any troubles with type loading: it will prevent false-positives and false-negatives from govet. 4. Describe almost all options in .golangci.example.yml and include it into README. Describe when to use slow or fast mode of govet. 5. Speed up govet: reuse AST parsing: it's already parsed once by golangci-lint. For "slow" runs (when we run at least one slow linter) speedup by not loading type information second time. 6. Improve logging, debug logging
1. Allow govet to work in 2 modes: fast and slow. Default is slow. In fast mode golangci-lint runs `go install -i` and `go test -i` for analyzed packages. But it's fast only when: - go >= 1.10 - it's repeated run or $GOPATH/pkg or `go env GOCACHE` is cached between CI builds In slow mode we load program from source code like for another linters and do it only once for all linters. 3. Patch govet code to warn about any troubles with the type information. Default behaviour of govet was to hide such warnings. Fail analysis if there are any troubles with type loading: it will prevent false-positives and false-negatives from govet. 4. Describe almost all options in .golangci.example.yml and include it into README. Describe when to use slow or fast mode of govet. 5. Speed up govet: reuse AST parsing: it's already parsed once by golangci-lint. For "slow" runs (when we run at least one slow linter) speedup by not loading type information second time. 6. Improve logging, debug logging 7. Fix crash in logging of AST cache warnings (#118)
1. Allow govet to work in 2 modes: fast and slow. Default is slow. In fast mode golangci-lint runs `go install -i` and `go test -i` for analyzed packages. But it's fast only when: - go >= 1.10 - it's repeated run or $GOPATH/pkg or `go env GOCACHE` is cached between CI builds In slow mode we load program from source code like for another linters and do it only once for all linters. 3. Patch govet code to warn about any troubles with the type information. Default behaviour of govet was to hide such warnings. Fail analysis if there are any troubles with type loading: it will prevent false-positives and false-negatives from govet. 4. Describe almost all options in .golangci.example.yml and include it into README. Describe when to use slow or fast mode of govet. 5. Speed up govet: reuse AST parsing: it's already parsed once by golangci-lint. For "slow" runs (when we run at least one slow linter) speedup by not loading type information second time. 6. Improve logging, debug logging 7. Fix crash in logging of AST cache warnings (#118)
This is fixed now I think? I'll close it. |
I know this report won't be that helpful, but I don't have much information.
I have this configuration:
Running
golangci-lint run
locally on my laptop results in the following error:But when this runs under CI (on Kochiku), no error is reported. I've run it on CI with
-v
and it gives the following:The CI gets the latest golangci-lint with:
And I'm using the same version locally.
Sorry I can't be of more help, but I can't get any more information out of golangci-lint or the CI.
The text was updated successfully, but these errors were encountered: