-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
govet. WARN [runner] Can't process result by autogenerated_exclude processor: can't filter issue #484
Comments
Same error here, not using docker. Executing golangci-lint via |
Hi, thank you for this issue! |
I am having a similar issue. The code I'm working on is this commit (current master) of docker/swarmkit: I installed
Then, I setup a run:
tests; false
linters:
disable-all: true
enable:
- govet
- misspell
- gofmt
- goimports
- golint
- ineffassign
- deadcode
- unconvert I run
In addition to the errors in the OP, note this line:
I tried these commands locally, but when they failed I switched to building and running the Docker image from the
This avoids all of the bind-mounting logic in the Makefile, to get a clean environment. Additionally, I suspected the problem was with my go version (1.11.0), so I changed it to 1.12.6 (the latest). Once the container started, I installed and ran
The resulting output is identical to the output running locally. My next suspicion was that the step in the Dockerfile doing The output was identical again, so the issue is not the installation of Removing Using the Dockerfile from the project should give an identical build environment for your reproduction. Hope this helps. |
Further information: I found the issue in the swarmkit file that was causing trouble. To do so, first I modified diff --git a/pkg/golinters/goanalysis/passes/nilness/nilness.go b/pkg/golinters/goanalysis/passes/nilness/nilness.go
index 7c1967b..3947813 100644
--- a/pkg/golinters/goanalysis/passes/nilness/nilness.go
+++ b/pkg/golinters/goanalysis/passes/nilness/nilness.go
@@ -75,7 +75,9 @@ func runFunc(pass *analysis.Pass, fn *ssa.Function) {
// notNil reports an error if v is provably nil.
notNil := func(stack []fact, instr ssa.Instruction, v ssa.Value, descr string) {
if nilnessOf(stack, v) == isnil {
- reportf("nilderef", instr.Pos(), "nil dereference in "+descr)
+ reportf("nilderef", instr.Pos(), "nil dereference in %v (%v)",
+ descr, instr.String(),
+ )
}
} This gave me enough information to start to puzzle out the problem. Specifically, the failed nilness analyzer now returned this:
I grepped the swarmkit codebase for // CancelAll aborts all pending restarts and waits for any instances of
// StartNow that have already triggered to complete.
func (r *Supervisor) CancelAll() {
var cancelled []delayedStart
r.mu.Lock()
for _, delay := range r.delays {
delay.cancel()
}
r.mu.Unlock()
for _, delay := range cancelled {
<-delay.doneCh
}
} The slice named I looked into fixing golangci-lint myself, but I don't quite have enough of an understanding of how it works to do so. |
I also have the same issue. INFO [runner] worker.1 took 5.528618411s with stages: govet: 5.52861159s
WARN [runner] Can't process result by autogenerated_exclude processor: can't filter issue result.Issue{FromLinter:"govet", Text:"nilness: tautological condition: nil == nil", Pos:token.Position{Filename:"", Offset:0, Line:0, Column:0}, LineRange:(*result.Range)(nil), HunkPos:0, SourceLines:[]string(nil), Replacement:(*result.Replacement)(nil)}: no file path for issue
WARN [runner] Can't process result by nolint processor: can't filter issue result.Issue{FromLinter:"govet", Text:"nilness: tautological condition: nil == nil", Pos:token.Position{Filename:"", Offset:0, Line:0, Column:0}, LineRange:(*result.Range)(nil), HunkPos:0, SourceLines:[]string(nil), Replacement:(*result.Replacement)(nil)}: no file path for issue
WARN [runner/source_code] Failed to get line 0 for file : failed to get file lines cache: can't get file bytes from cache: can't read file : open : no such file or directory
:0: nilness: tautological condition: nil == nil (govet) May be associated with check-shadowing. govet:
check-shadowing: true |
Similar issues for me:
This is keeping me from switching |
Same issue here Command I ran: Output I got:
|
I've just seen this, too:
I found that turning off #.golangci.yml
govet:
#check-shadowing: true So on the suspicion that this linter bug was tripped by something (unrelated to the changes) in a recently changed file, I went and changed this for _, snp := range output.DBSnapshots {
- dbSnp := DBSnapshot{
+ dbSnp := &DBSnapshot{
Key: value,
}
- result = append(result, &dbSnp)
+ result = append(result, dbSnp)
} |
I was able to reproduce the same scenario, where the variable is declared but never initialized. |
I am seeing this from golangci.com: https://golangci.com/r/github.com/gonum/gonum/pulls/1077
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
golang-ci started from docker. v1.16.0
config:
unclear message. may be an issue in a lambda-function
The text was updated successfully, but these errors were encountered: