@@ -2,6 +2,7 @@ package bench
22
33import (
44 "bytes"
5+ "context"
56 "errors"
67 "fmt"
78 "go/build"
@@ -63,7 +64,8 @@ func Benchmark_linters(b *testing.B) {
6364
6465 for _ , repo := range repos {
6566 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 ()
6769
6870 err = os .Chdir (repo .dir )
6971 require .NoErrorf (b , err , "can't chdir to %s" , repo .dir )
@@ -94,7 +96,8 @@ func Benchmark_golangciLint(b *testing.B) {
9496
9597 installGolangCILint (b )
9698
97- _ = exec .Command (binName , "cache" , "clean" ).Run ()
99+ // TODO(ldez): clean inside go1.25 PR
100+ _ = exec .CommandContext (context .Background (), binName , "cache" , "clean" ).Run ()
98101
99102 cases := getAllRepositories (b )
100103
@@ -177,7 +180,8 @@ func cloneGithubProject(tb testing.TB, benchRoot, owner, name string) string {
177180 if _ , err := os .Stat (dir ); os .IsNotExist (err ) {
178181 repo := fmt .Sprintf ("https://github.com/%s/%s.git" , owner , name )
179182
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 ()
181185 if err != nil {
182186 tb .Fatalf ("can't git clone %s/%s: %s" , owner , name , err )
183187 }
@@ -210,7 +214,8 @@ func launch(tb testing.TB, run func(testing.TB, string, []string), args []string
210214func run (tb testing.TB , name string , args []string ) {
211215 tb .Helper ()
212216
213- cmd := exec .Command (name , args ... )
217+ // TODO(ldez): clean inside go1.25 PR
218+ cmd := exec .CommandContext (context .Background (), name , args ... )
214219 if os .Getenv ("PRINT_CMD" ) == "1" {
215220 log .Print (strings .Join (cmd .Args , " " ))
216221 }
@@ -228,7 +233,8 @@ func run(tb testing.TB, name string, args []string) {
228233func countGoLines (tb testing.TB ) int {
229234 tb .Helper ()
230235
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` )
232238
233239 out , err := cmd .CombinedOutput ()
234240 if err != nil {
@@ -341,7 +347,8 @@ func installGolangCILint(tb testing.TB) {
341347
342348 parentPath := findMakefile (tb )
343349
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" )
345352
346353 output , err := cmd .CombinedOutput ()
347354 if err != nil {
0 commit comments