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

cmd/vet: warn of cyclic closures that cause Finalizers not to run #7546

Open
slimsag opened this issue Mar 14, 2014 · 2 comments
Open

cmd/vet: warn of cyclic closures that cause Finalizers not to run #7546

slimsag opened this issue Mar 14, 2014 · 2 comments
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis)
Milestone

Comments

@slimsag
Copy link

slimsag commented Mar 14, 2014

What does 'go version' print?
go version devel +08dcdcdb757b Thu Mar 13 14:04:29 2014 -0700 linux/amd64

What steps reproduce the problem?
1. http://play.golang.org/p/QWn904819Y

What happened?
A tricky case with Finalizers and closures can be created where the Finalizer will not
run due to the cyclic structure created (not a bug). Go vet does not complain about suck
tricky cases which could be useful.

What should have happened instead?
Go vet should warn of such tricky cases.
@ianlancetaylor
Copy link
Contributor

Comment 1:

I don't really see how this could be done in a tool like vet, but I'd be happy to hear
suggestions.

Labels changed: added repo-tools, release-none.

@gopherbot
Copy link

Comment 2:

CL https://golang.org/cl/97480043 mentions this issue.

@bradfitz bradfitz removed the new label Dec 18, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@rsc rsc removed the release-none label Apr 10, 2015
@rsc rsc changed the title cmd/vet: warn of cyclic closures that cause Finalizers not to run x/tools/cmd/vet: warn of cyclic closures that cause Finalizers not to run Apr 14, 2015
@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015
@rsc rsc removed the repo-tools label Apr 14, 2015
dominikh added a commit to dominikh/go-staticcheck that referenced this issue Nov 13, 2016
Based on golang/go#7546

Idea-By: Stephen Gutekanst <stephen.gutekanst@gmail.com>
dominikh added a commit to dominikh/go-tools that referenced this issue Jan 24, 2017
Based on golang/go#7546

Idea-By: Stephen Gutekanst <stephen.gutekanst@gmail.com>
@mvdan mvdan changed the title x/tools/cmd/vet: warn of cyclic closures that cause Finalizers not to run cmd/vet: warn of cyclic closures that cause Finalizers not to run May 31, 2018
@adonovan adonovan added the Analysis Issues related to static analysis (vet, x/tools/go/analysis) label Apr 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis)
Projects
None yet
Development

No branches or pull requests

6 participants