Closed m3rolam closed 1 month ago
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.
FWIW: I believe the removal of SetAnalyzerGoVersion
in this PR was the cause. https://github.com/golangci/golangci-lint/pull/4907. However, I'm unfamiliar with the project enough to make a meaningful contribution at this time.
I believe the removal of SetAnalyzerGoVersion in this PR was the cause.
Not really, the problem is that Go is now more strict with Go version used on files.
So the problem is the build tags inside newrelic lib.
Ah, that makes sense. Thanks for clarifying!
The build tags have been removed inside v3.34.0 because it was a problem to compile https://github.com/newrelic/go-agent/pull/940
https://github.com/newrelic/go-agent/blob/v3.34.0/v3/newrelic/sql_driver.go
I will close this issue.
@ldez I understand that it's been removed in newer versions, but what I'm confused about is why the linter would pop positive on 3rd party dependency issues for typecheck
errors. That seems like a unwanted behavior.
golangci-lint and linters rely on Go tooling, if a linter or Go changes the way to handle something, we have no choice.
The change was required for staticcheck but it's not his fault, the change was just here to follow Go new version handling.
The typecheck
errors reported are not related to a specific linter but to how Go handles versions:
https://github.com/golang/go/blob/d2879efd0227df32d6aeee1be58c325b477f22d4/src/go/types/api.go#L122-L127
So yes, it's unwanted, but there are no other solutions.
Any way to suppress this errors?
I don't want to update infra libraries right now.
Standard way with disable linter or add an exclude-rules
seems not working in this case.
I've try to remove typecheck
from linters.enable
And also try to add
issues:
exclude-rules:
- source: "vendor/github.com/newrelic/go-agent/v3/newrelic/sql_driver.go"
text: "typecheck"
With no luck.
Welcome
typecheck
section of the FAQ.Description of the problem
After upgrading to golangci-lint v1.60.2, we are receiving errors for
predeclared any
typecheck errors for vendored third-party modules.Example error:
Version of golangci-lint
Configuration
Go environment
Verbose output of running
A minimal reproducible example or link to a public repository
Validation
Supporter