]> Cypherpunks repositories - gostls13.git/commit
cmd/vet: bring in pass to catch invalid uses of testing.T in goroutines
authorEmmanuel T Odeke <emmanuel@orijtech.com>
Fri, 29 May 2020 09:17:38 +0000 (02:17 -0700)
committerEmmanuel Odeke <emmanuel@orijtech.com>
Sun, 1 Nov 2020 01:58:43 +0000 (01:58 +0000)
commit5a267c840ae16c1cc7352caa14da5f500d03d338
treef24d82edc3b182ecb16814a86d5e386666448b04
parent063a91c0abef445154df1ba34ffb500eeccfe8bc
cmd/vet: bring in pass to catch invalid uses of testing.T in goroutines

Add "go/analysis/passes/testinggoroutine" from x/tools and vendor its source in.
This pass will catch misuses of:
* testing.T.Fail*
* testing.T.Fatal*
* testing.T.Skip*
inside goroutines explicitly started by the go keyword.

The pass was implemented in CL 212920.

While here, found 2 misuses in:
* database/sql/sql_test.go
* runtime/syscall_windows_test.go
and fixed them in CL 235527.

Fixes #5746

Change-Id: I1740ad3f1d677bb5d78dc5d8d66bac6ec287a2b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/235677
Run-TryBot: Emmanuel Odeke <emmanuel@orijtech.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Trust: Emmanuel Odeke <emmanuel@orijtech.com>
src/cmd/vendor/golang.org/x/tools/go/analysis/passes/testinggoroutine/testinggoroutine.go [new file with mode: 0644]
src/cmd/vet/main.go