File tree 38 files changed +782
-133
lines changed
38 files changed +782
-133
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,25 @@ import (
9
9
"testing"
10
10
)
11
11
12
+ func bar () func (t * testing.T ) {
13
+ return func (t * testing.T ) {
14
+ context .Background () // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
15
+ }
16
+ }
17
+
18
+ func bur (t * testing.T ) func () {
19
+ return func () {
20
+ context .Background () // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
21
+ }
22
+ }
23
+
24
+ func bir (t * testing.T ) func () {
25
+ context .Background () // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
26
+ return func () {
27
+ context .Background () // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
28
+ }
29
+ }
30
+
12
31
func Test_NoName (_ * testing.T ) {
13
32
context .Background () // want `context\.Background\(\) could be replaced by <t/b>\.Context\(\) in .+`
14
33
}
Original file line number Diff line number Diff line change @@ -9,6 +9,25 @@ import (
9
9
"testing"
10
10
)
11
11
12
+ func bar() func(t *testing.T) {
13
+ return func(t *testing.T) {
14
+ t.Context() // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
15
+ }
16
+ }
17
+
18
+ func bur(t *testing.T) func() {
19
+ return func() {
20
+ t.Context() // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
21
+ }
22
+ }
23
+
24
+ func bir(t *testing.T) func() {
25
+ t.Context() // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
26
+ return func() {
27
+ t.Context() // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
28
+ }
29
+ }
30
+
12
31
func Test_NoName(_ *testing.T) {
13
32
context.Background() // want `context\.Background\(\) could be replaced by <t/b>\.Context\(\) in .+`
14
33
}
Original file line number Diff line number Diff line change @@ -9,6 +9,25 @@ import (
9
9
"testing"
10
10
)
11
11
12
+ func bar () func (t * testing.T ) {
13
+ return func (t * testing.T ) {
14
+ context .Background ()
15
+ }
16
+ }
17
+
18
+ func bur (t * testing.T ) func () {
19
+ return func () {
20
+ context .Background ()
21
+ }
22
+ }
23
+
24
+ func bir (t * testing.T ) func () {
25
+ context .Background ()
26
+ return func () {
27
+ context .Background ()
28
+ }
29
+ }
30
+
12
31
func Test_NoName (_ * testing.T ) {
13
32
context .Background ()
14
33
}
Original file line number Diff line number Diff line change @@ -9,6 +9,25 @@ import (
9
9
"testing"
10
10
)
11
11
12
+ func bar () func (t * testing.T ) {
13
+ return func (t * testing.T ) {
14
+ Background () // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
15
+ }
16
+ }
17
+
18
+ func bur (t * testing.T ) func () {
19
+ return func () {
20
+ Background () // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
21
+ }
22
+ }
23
+
24
+ func bir (t * testing.T ) func () {
25
+ Background () // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
26
+ return func () {
27
+ Background () // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
28
+ }
29
+ }
30
+
12
31
func Test_NoName (_ * testing.T ) {
13
32
Background () // want `context\.Background\(\) could be replaced by <t/b>\.Context\(\) in .+`
14
33
}
Original file line number Diff line number Diff line change @@ -9,6 +9,25 @@ import (
9
9
"testing"
10
10
)
11
11
12
+ func bar() func(t *testing.T) {
13
+ return func(t *testing.T) {
14
+ t.Context() // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
15
+ }
16
+ }
17
+
18
+ func bur(t *testing.T) func() {
19
+ return func() {
20
+ t.Context() // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
21
+ }
22
+ }
23
+
24
+ func bir(t *testing.T) func() {
25
+ t.Context() // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
26
+ return func() {
27
+ t.Context() // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
28
+ }
29
+ }
30
+
12
31
func Test_NoName(_ *testing.T) {
13
32
Background() // want `context\.Background\(\) could be replaced by <t/b>\.Context\(\) in .+`
14
33
}
Original file line number Diff line number Diff line change @@ -9,6 +9,25 @@ import (
9
9
"testing"
10
10
)
11
11
12
+ func bar () func (t * testing.T ) {
13
+ return func (t * testing.T ) {
14
+ context .Background () // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
15
+ }
16
+ }
17
+
18
+ func bur (t * testing.T ) func () {
19
+ return func () {
20
+ context .Background () // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
21
+ }
22
+ }
23
+
24
+ func bir (t * testing.T ) func () {
25
+ context .Background () // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
26
+ return func () {
27
+ context .Background () // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
28
+ }
29
+ }
30
+
12
31
func FunctionNoName (_ * testing.T ) {
13
32
context .Background () // want `context\.Background\(\) could be replaced by <t/b>\.Context\(\) in .+`
14
33
}
Original file line number Diff line number Diff line change @@ -9,6 +9,25 @@ import (
9
9
"testing"
10
10
)
11
11
12
+ func bar() func(t *testing.T) {
13
+ return func(t *testing.T) {
14
+ t.Context() // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
15
+ }
16
+ }
17
+
18
+ func bur(t *testing.T) func() {
19
+ return func() {
20
+ t.Context() // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
21
+ }
22
+ }
23
+
24
+ func bir(t *testing.T) func() {
25
+ t.Context() // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
26
+ return func() {
27
+ t.Context() // want `context\.Background\(\) could be replaced by t\.Context\(\) in .+`
28
+ }
29
+ }
30
+
12
31
func FunctionNoName(_ *testing.T) {
13
32
context.Background() // want `context\.Background\(\) could be replaced by <t/b>\.Context\(\) in .+`
14
33
}
Original file line number Diff line number Diff line change @@ -9,6 +9,25 @@ import (
9
9
"testing"
10
10
)
11
11
12
+ func bar () func (t * testing.T ) {
13
+ return func (t * testing.T ) {
14
+ context .TODO () // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
15
+ }
16
+ }
17
+
18
+ func bur (t * testing.T ) func () {
19
+ return func () {
20
+ context .TODO () // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
21
+ }
22
+ }
23
+
24
+ func bir (t * testing.T ) func () {
25
+ context .TODO () // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
26
+ return func () {
27
+ context .TODO () // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
28
+ }
29
+ }
30
+
12
31
func Test_NoName (_ * testing.T ) {
13
32
context .TODO () // want `context\.TODO\(\) could be replaced by <t/b>\.Context\(\) in .+`
14
33
}
Original file line number Diff line number Diff line change @@ -9,6 +9,25 @@ import (
9
9
"testing"
10
10
)
11
11
12
+ func bar() func(t *testing.T) {
13
+ return func(t *testing.T) {
14
+ t.Context() // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
15
+ }
16
+ }
17
+
18
+ func bur(t *testing.T) func() {
19
+ return func() {
20
+ t.Context() // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
21
+ }
22
+ }
23
+
24
+ func bir(t *testing.T) func() {
25
+ t.Context() // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
26
+ return func() {
27
+ t.Context() // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
28
+ }
29
+ }
30
+
12
31
func Test_NoName(_ *testing.T) {
13
32
context.TODO() // want `context\.TODO\(\) could be replaced by <t/b>\.Context\(\) in .+`
14
33
}
Original file line number Diff line number Diff line change @@ -9,6 +9,25 @@ import (
9
9
"testing"
10
10
)
11
11
12
+ func bar () func (t * testing.T ) {
13
+ return func (t * testing.T ) {
14
+ context .TODO ()
15
+ }
16
+ }
17
+
18
+ func bur (t * testing.T ) func () {
19
+ return func () {
20
+ context .TODO ()
21
+ }
22
+ }
23
+
24
+ func bir (t * testing.T ) func () {
25
+ context .TODO ()
26
+ return func () {
27
+ context .TODO ()
28
+ }
29
+ }
30
+
12
31
func Test_NoName (_ * testing.T ) {
13
32
context .TODO ()
14
33
}
Original file line number Diff line number Diff line change 1
1
package dot
2
2
3
3
import (
4
- "context"
5
4
. "context"
6
5
"errors"
7
6
"fmt"
@@ -10,6 +9,25 @@ import (
10
9
"testing"
11
10
)
12
11
12
+ func bar () func (t * testing.T ) {
13
+ return func (t * testing.T ) {
14
+ TODO () // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
15
+ }
16
+ }
17
+
18
+ func bur (t * testing.T ) func () {
19
+ return func () {
20
+ TODO () // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
21
+ }
22
+ }
23
+
24
+ func bir (t * testing.T ) func () {
25
+ TODO () // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
26
+ return func () {
27
+ TODO () // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
28
+ }
29
+ }
30
+
13
31
func Test_NoName (_ * testing.T ) {
14
32
TODO () // want `context\.TODO\(\) could be replaced by <t/b>\.Context\(\) in .+`
15
33
}
@@ -81,7 +99,7 @@ func Test_GoStmt(t *testing.T) {
81
99
}
82
100
83
101
func Test_GoStmt_arg (t * testing.T ) {
84
- go func (ctx context. Context ) {}(TODO ()) // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
102
+ go func (ctx Context ) {}(TODO ()) // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
85
103
}
86
104
87
105
func Test_CallExpr_recursive (t * testing.T ) {
@@ -121,7 +139,7 @@ func Test_SwitchStmt_case(t *testing.T) {
121
139
}
122
140
123
141
func Test_DeclStmt (t * testing.T ) {
124
- var ctx context. Context = TODO () // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
142
+ var ctx Context = TODO () // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
125
143
_ = ctx
126
144
}
127
145
Original file line number Diff line number Diff line change 1
1
package dot
2
2
3
3
import (
4
- "context"
5
4
. "context"
6
5
"errors"
7
6
"fmt"
@@ -10,6 +9,25 @@ import (
10
9
"testing"
11
10
)
12
11
12
+ func bar() func(t *testing.T) {
13
+ return func(t *testing.T) {
14
+ t.Context() // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
15
+ }
16
+ }
17
+
18
+ func bur(t *testing.T) func() {
19
+ return func() {
20
+ t.Context() // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
21
+ }
22
+ }
23
+
24
+ func bir(t *testing.T) func() {
25
+ t.Context() // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
26
+ return func() {
27
+ t.Context() // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
28
+ }
29
+ }
30
+
13
31
func Test_NoName(_ *testing.T) {
14
32
TODO() // want `context\.TODO\(\) could be replaced by <t/b>\.Context\(\) in .+`
15
33
}
@@ -81,7 +99,7 @@ func Test_GoStmt(t *testing.T) {
81
99
}
82
100
83
101
func Test_GoStmt_arg(t *testing.T) {
84
- go func(ctx context. Context) {}(t.Context()) // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
102
+ go func(ctx Context) {}(t.Context()) // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
85
103
}
86
104
87
105
func Test_CallExpr_recursive(t *testing.T) {
@@ -121,7 +139,7 @@ func Test_SwitchStmt_case(t *testing.T) {
121
139
}
122
140
123
141
func Test_DeclStmt(t *testing.T) {
124
- var ctx context. Context = t.Context() // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
142
+ var ctx Context = t.Context() // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
125
143
_ = ctx
126
144
}
127
145
Original file line number Diff line number Diff line change @@ -9,6 +9,25 @@ import (
9
9
"testing"
10
10
)
11
11
12
+ func bar () func (t * testing.T ) {
13
+ return func (t * testing.T ) {
14
+ context .TODO () // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
15
+ }
16
+ }
17
+
18
+ func bur (t * testing.T ) func () {
19
+ return func () {
20
+ context .TODO () // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
21
+ }
22
+ }
23
+
24
+ func bir (t * testing.T ) func () {
25
+ context .TODO () // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
26
+ return func () {
27
+ context .TODO () // want `context\.TODO\(\) could be replaced by t\.Context\(\) in .+`
28
+ }
29
+ }
30
+
12
31
func FunctionNoName (_ * testing.T ) {
13
32
context .TODO () // want `context\.TODO\(\) could be replaced by <t/b>\.Context\(\) in .+`
14
33
}
You can’t perform that action at this time.
0 commit comments