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
proposal: cmd/vet: warn for passing invalid arguments to runtime.SetFinalizer #48019
Comments
Can you clarify the check that the proposed Analyzer will enforce in the description? The documentation is a bit ambiguous on the syntactic requirements on |
(Not an obvious no but something to consider.) |
What is the failure mode of |
How are you supposed to statically determine how a variable was allocated? I don't think this is possible to do nearly precisely enough, even if it were a valuable test to add. |
Firstly, thank you all for your nice feedbacks!
Ok, I’ll leave a comment about the details soon.
Of course, this check may not meet the frequency requirements as much as
That’s true. I also think it’s impossible to catch a case where needs runtime information. But, we can still prevent many errors through this analyzer, and since it is not different from what we did in the existing analyzers such as |
Is there an estimate of how many uses of |
I agree with @bcmills's implication that this check is not worth adding to vet. Everything that vet can check will be checked at runtime by |
Sorry for not leaving a comment sooner. I've been very busy these days. 😅 After thinking about this proposal for a few days, I decided to withdraw my proposal. Thanks again for your feedbacks. |
This proposal has been declined as retracted. |
Proposal
Now, the
vet
tool don't warn for callingruntime.SetFinalizer
with arguments that do not meet its specification, even if it makes unrecoverable error.So, I suggest that make vet warn for passing invalid arguments to
runtime.SetFinalizer
.golang/tools#335
The text was updated successfully, but these errors were encountered: