Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / staticcheck / testdata / src / CheckConcurrentTesting / CheckConcurrentTesting.go
1 package pkg
2
3 import "testing"
4
5 func fn1() {
6         var t *testing.T
7         go func() { // want `the goroutine calls T\.Fatal, which must be called in the same goroutine as the test`
8                 t.Fatal()
9         }()
10         go fn2(t) // want `the goroutine calls T\.Fatal, which must be called in the same goroutine as the test`
11
12         fn := func() {
13                 t.Fatal()
14         }
15         go fn() // want `the goroutine calls T\.Fatal, which must be called in the same goroutine as the test`
16 }
17
18 func fn2(t *testing.T) {
19         t.Fatal()
20 }
21
22 func fn3(t *testing.T) {
23         fn := func() {
24                 t.Fatal()
25         }
26         fn()
27 }
28
29 func fn4(t *testing.T) {
30         t.Fatal()
31 }
32
33 func fn5(t *testing.T) {
34         func() {
35                 t.Fatal()
36         }()
37 }