Skip to content

x/tools/go/analysis/passes/testinggoroutine: ignore subtests in goroutines (false positive) #63799

Closed
@Antonboom

Description

@Antonboom

Hi!

Looks like invalid checker behaviour:

func TestGoSubtest(t *testing.T) {
	done := make(chan struct{})
	go func() {
		defer close(done)
		t.Run("", func(t *testing.T) {
			t.Fatal()
		})
	}()
	<-done
}
$ go vet -testinggoroutine some_test.go
# command-line-arguments_test
..._test.go:56:4: call to (*T).Fatal from a non-test goroutine

Metadata

Metadata

Assignees

Labels

AnalysisIssues related to static analysis (vet, x/tools/go/analysis)FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions