@@ -2,7 +2,6 @@ package bench
2
2
3
3
import (
4
4
"bytes"
5
- "context"
6
5
"errors"
7
6
"fmt"
8
7
"go/build"
@@ -55,8 +54,7 @@ func Benchmark_linters(b *testing.B) {
55
54
56
55
for _ , repo := range repos {
57
56
b .Run (repo .name , func (b * testing.B ) {
58
- // TODO(ldez): clean inside go1.25 PR
59
- _ = exec .CommandContext (context .Background (), binName , "cache" , "clean" ).Run ()
57
+ _ = exec .CommandContext (b .Context (), binName , "cache" , "clean" ).Run ()
60
58
61
59
b .Chdir (repo .dir )
62
60
@@ -77,8 +75,7 @@ func Benchmark_linters(b *testing.B) {
77
75
func Benchmark_golangciLint (b * testing.B ) {
78
76
installGolangCILint (b )
79
77
80
- // TODO(ldez): clean inside go1.25 PR
81
- _ = exec .CommandContext (context .Background (), binName , "cache" , "clean" ).Run ()
78
+ _ = exec .CommandContext (b .Context (), binName , "cache" , "clean" ).Run ()
82
79
83
80
cases := getAllRepositories (b )
84
81
@@ -160,8 +157,7 @@ func cloneGithubProject(tb testing.TB, benchRoot, owner, name string) string {
160
157
if _ , err := os .Stat (dir ); os .IsNotExist (err ) {
161
158
repo := fmt .Sprintf ("https://github.com/%s/%s.git" , owner , name )
162
159
163
- // TODO(ldez): clean inside go1.25 PR
164
- err = exec .CommandContext (context .Background (), "git" , "clone" , "--depth" , "1" , "--single-branch" , repo , dir ).Run ()
160
+ err = exec .CommandContext (tb .Context (), "git" , "clone" , "--depth" , "1" , "--single-branch" , repo , dir ).Run ()
165
161
if err != nil {
166
162
tb .Fatalf ("can't git clone %s/%s: %s" , owner , name , err )
167
163
}
@@ -194,8 +190,7 @@ func launch(tb testing.TB, run func(testing.TB, string, []string), args []string
194
190
func run (tb testing.TB , name string , args []string ) {
195
191
tb .Helper ()
196
192
197
- // TODO(ldez): clean inside go1.25 PR
198
- cmd := exec .CommandContext (context .Background (), name , args ... )
193
+ cmd := exec .CommandContext (tb .Context (), name , args ... )
199
194
if os .Getenv ("PRINT_CMD" ) == "1" {
200
195
log .Print (strings .Join (cmd .Args , " " ))
201
196
}
@@ -213,8 +208,7 @@ func run(tb testing.TB, name string, args []string) {
213
208
func countGoLines (tb testing.TB ) int {
214
209
tb .Helper ()
215
210
216
- // TODO(ldez): clean inside go1.25 PR
217
- cmd := exec .CommandContext (context .Background (), "bash" , "-c" , `find . -type f -name "*.go" | grep -F -v vendor | xargs wc -l | tail -1` )
211
+ cmd := exec .CommandContext (tb .Context (), "bash" , "-c" , `find . -type f -name "*.go" | grep -F -v vendor | xargs wc -l | tail -1` )
218
212
219
213
out , err := cmd .CombinedOutput ()
220
214
if err != nil {
@@ -327,8 +321,7 @@ func installGolangCILint(tb testing.TB) {
327
321
328
322
parentPath := findMakefile (tb )
329
323
330
- // TODO(ldez): clean inside go1.25 PR
331
- cmd := exec .CommandContext (context .Background (), "make" , "-C" , parentPath , "build" )
324
+ cmd := exec .CommandContext (tb .Context (), "make" , "-C" , parentPath , "build" )
332
325
333
326
output , err := cmd .CombinedOutput ()
334
327
if err != nil {
0 commit comments