-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
staticcheck: missed deprecated references within struct initializer #607
Comments
That seems like a false negative, I'll look into it.
This is working as intended. Deprecation is intended for exported API that should no longer be used by other packages. A package that has deprecated API can, however, still use that very API to implement the non-deprecated alternatives. Consider this example:
Furthermore, there is no notion of deprecating unexported API that would cause intra-package deprecation warnings. |
We also encountered the issue that staticcheck does not complain if a deprecated struct field is assigned when the struct is instantiated (in another package). This causes that from now and then new code is introduced that accidentally uses deprecated functionality in our codebase. What would need to be changed to fix the issue? If it's not too complicated / a lot of effort, I could give it a try. |
#1382 seems to fix it, so I think it worths a look! @dominikh |
The deprecation linter has false-negatives when:
$ cat example.go
:$ cat bar/obj.go
:Actual output:
Expected output:
Versions etc:
Thanks for such a great tool!
The text was updated successfully, but these errors were encountered: