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

Comments

Projects
None yet
5 participants
@slimsag

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

This comment has been minimized.

Contributor

ianlancetaylor commented May 9, 2014

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

This comment has been minimized.

gopherbot commented May 14, 2014

Comment 2:

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

@slimsag slimsag added new labels May 14, 2014

@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 from cmd/vet: warn of cyclic closures that cause Finalizers not to run to 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

Detect cyclic finalizers
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

Detect cyclic finalizers
Based on golang/go#7546

Idea-By: Stephen Gutekanst <stephen.gutekanst@gmail.com>

@mvdan mvdan changed the title from x/tools/cmd/vet: warn of cyclic closures that cause Finalizers not to run to cmd/vet: warn of cyclic closures that cause Finalizers not to run May 31, 2018

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