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

x/tools/go/analysis/passes: testinggoroutine does not emit report for defined/anonymous functions #47470

Closed
cuonglm opened this issue Jul 30, 2021 · 1 comment
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis) FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@cuonglm
Copy link
Member

cuonglm commented Jul 30, 2021

With current golang.org/x/tools tip, the testinggoroutine does not emit error report for:

func f(t *testing.T) {
	t.Fatal("TestFailed")
}

func TestBadFatal(t *testing.T) {
	go f(t) // want "call to .+T.+Fatal from a non-test goroutine" but currently not

	g := func(t *testing.T) {
		t.Fatal("TestFailed")
	}
	go g(t) // want "call to .+T.+Fatal from a non-test goroutine" but currently not
}

cc @odeke-em

@cuonglm cuonglm added Tools This label describes issues relating to any tools in the x/tools repository. Analysis Issues related to static analysis (vet, x/tools/go/analysis) labels Jul 30, 2021
@cuonglm cuonglm self-assigned this Jul 30, 2021
@gopherbot gopherbot added this to the Unreleased milestone Jul 30, 2021
@gopherbot
Copy link

Change https://golang.org/cl/338529 mentions this issue: go/analysis: testinggoroutine inspects defined/anonymous functions

@rsc rsc unassigned cuonglm Jun 23, 2022
@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Analysis Issues related to static analysis (vet, x/tools/go/analysis) FrozenDueToAge Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

2 participants