-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
go/analysis/passes/testinggoroutine: report by enclosing regions
This adds support for t.Run() statements. The new version performs two passes. The first pass collects all of the `go callee` and `t.Run(name, callee)` statements. The second pass inspects each callee FuncDecl or FuncLit for a call to a tb.Forbidden() function. When the enclosing callee function called from an t.Run() statement, it reports when tb is declared outside of the body of the enclosing function. Fixes golang/go#63799 Updates golang/go#63849 Updates golang/go#48124 Change-Id: I10d5f2a0af9b985126dbfcc98eaab97757a7f71d Reviewed-on: https://go-review.googlesource.com/c/tools/+/541155 TryBot-Result: Gopher Robot <gobot@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Findley <rfindley@google.com> Run-TryBot: Tim King <taking@google.com>
- Loading branch information
1 parent
b19be0f
commit 1733061
Showing
8 changed files
with
503 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,8 @@ | |
|
||
package a | ||
|
||
func h() {} | ||
import "testing" | ||
|
||
func helper(t *testing.T) { | ||
t.Skip() | ||
} |
Oops, something went wrong.