Skip to content
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

U1000: Potential False Positive On Embedding Type Aliased Interfaces In Structs #1365

Closed
MadhavJivrajani opened this issue Feb 9, 2023 · 1 comment

Comments

@MadhavJivrajani
Copy link

What Happened

We bumped the version of staticcheck (v0.4.0) in Kubernetes to incorporate go1.20 related changes. PR: kubernetes/kubernetes#115537

We are also using go1.20 on master (ref: kubernetes/kubernetes#114502)

Due to improvements to linters, a few things were flagged, out of which one of the flagged instances seems to be a false positive.
Here are the failure logs from the failed run: https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/115537/pull-kubernetes-verify/1622491177255178240

Here is part of the code that was flagged:

https://github.com/kubernetes/kubernetes/blob/19eddfc5675c3a9206e33333719bcf719bb99928/test/integration/apiserver/discovery/discovery_test.go#L55-L71

Before adding the comments to exclude the warnings, from the logs:

test/integration/apiserver/discovery/discovery_test.go:55:6: type `kubeClientSet` is unused (unused)
[1015](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/115537/pull-kubernetes-verify/1622491177255178240#1:build-log.txt%3A1015)
type kubeClientSet = kubernetes.Interface
[1016](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/115537/pull-kubernetes-verify/1622491177255178240#1:build-log.txt%3A1016)
     ^

Considering that the type aliases are in fact used, is this warning valid or is it a false positive? Please note that this warning did not surface on a version before v0.4.0.

@dominikh
Copy link
Owner

dominikh commented Feb 9, 2023

Those look like false positives, yes. Will fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants