@@ -2,6 +2,7 @@ package bench
2
2
3
3
import (
4
4
"bytes"
5
+ "context"
5
6
"errors"
6
7
"fmt"
7
8
"go/build"
@@ -63,7 +64,8 @@ func Benchmark_linters(b *testing.B) {
63
64
64
65
for _ , repo := range repos {
65
66
b .Run (repo .name , func (b * testing.B ) {
66
- _ = exec .Command (binName , "cache" , "clean" ).Run ()
67
+ // TODO(ldez): clean inside go1.25 PR
68
+ _ = exec .CommandContext (context .Background (), binName , "cache" , "clean" ).Run ()
67
69
68
70
err = os .Chdir (repo .dir )
69
71
require .NoErrorf (b , err , "can't chdir to %s" , repo .dir )
@@ -94,7 +96,8 @@ func Benchmark_golangciLint(b *testing.B) {
94
96
95
97
installGolangCILint (b )
96
98
97
- _ = exec .Command (binName , "cache" , "clean" ).Run ()
99
+ // TODO(ldez): clean inside go1.25 PR
100
+ _ = exec .CommandContext (context .Background (), binName , "cache" , "clean" ).Run ()
98
101
99
102
cases := getAllRepositories (b )
100
103
@@ -177,7 +180,8 @@ func cloneGithubProject(tb testing.TB, benchRoot, owner, name string) string {
177
180
if _ , err := os .Stat (dir ); os .IsNotExist (err ) {
178
181
repo := fmt .Sprintf ("https://github.com/%s/%s.git" , owner , name )
179
182
180
- err = exec .Command ("git" , "clone" , "--depth" , "1" , "--single-branch" , repo , dir ).Run ()
183
+ // TODO(ldez): clean inside go1.25 PR
184
+ err = exec .CommandContext (context .Background (), "git" , "clone" , "--depth" , "1" , "--single-branch" , repo , dir ).Run ()
181
185
if err != nil {
182
186
tb .Fatalf ("can't git clone %s/%s: %s" , owner , name , err )
183
187
}
@@ -210,7 +214,8 @@ func launch(tb testing.TB, run func(testing.TB, string, []string), args []string
210
214
func run (tb testing.TB , name string , args []string ) {
211
215
tb .Helper ()
212
216
213
- cmd := exec .Command (name , args ... )
217
+ // TODO(ldez): clean inside go1.25 PR
218
+ cmd := exec .CommandContext (context .Background (), name , args ... )
214
219
if os .Getenv ("PRINT_CMD" ) == "1" {
215
220
log .Print (strings .Join (cmd .Args , " " ))
216
221
}
@@ -228,7 +233,8 @@ func run(tb testing.TB, name string, args []string) {
228
233
func countGoLines (tb testing.TB ) int {
229
234
tb .Helper ()
230
235
231
- cmd := exec .Command ("bash" , "-c" , `find . -type f -name "*.go" | grep -F -v vendor | xargs wc -l | tail -1` )
236
+ // TODO(ldez): clean inside go1.25 PR
237
+ cmd := exec .CommandContext (context .Background (), "bash" , "-c" , `find . -type f -name "*.go" | grep -F -v vendor | xargs wc -l | tail -1` )
232
238
233
239
out , err := cmd .CombinedOutput ()
234
240
if err != nil {
@@ -341,7 +347,8 @@ func installGolangCILint(tb testing.TB) {
341
347
342
348
parentPath := findMakefile (tb )
343
349
344
- cmd := exec .Command ("make" , "-C" , parentPath , "build" )
350
+ // TODO(ldez): clean inside go1.25 PR
351
+ cmd := exec .CommandContext (context .Background (), "make" , "-C" , parentPath , "build" )
345
352
346
353
output , err := cmd .CombinedOutput ()
347
354
if err != nil {
0 commit comments