@@ -4,15 +4,12 @@ import (
4
4
"os"
5
5
"os/exec"
6
6
"path/filepath"
7
- "runtime"
8
- "slices"
9
7
"strings"
10
8
"sync"
11
9
"syscall"
12
10
"testing"
13
11
"time"
14
12
15
- hcversion "github.com/hashicorp/go-version"
16
13
"github.com/stretchr/testify/assert"
17
14
"github.com/stretchr/testify/require"
18
15
@@ -153,14 +150,6 @@ func (b *RunnerBuilder) WithArgs(args ...string) *RunnerBuilder {
153
150
return b
154
151
}
155
152
156
- // ForceDisableUnsupportedLinters temporary method to disable some linters.
157
- // TODO(ldez) remove when we will run go1.23 on the CI.
158
- func (b * RunnerBuilder ) ForceDisableUnsupportedLinters () * RunnerBuilder {
159
- b .args = forceDisableUnsupportedLinters (b .args )
160
-
161
- return b
162
- }
163
-
164
153
func (b * RunnerBuilder ) WithTargetPath (targets ... string ) * RunnerBuilder {
165
154
b .target = filepath .Join (targets ... )
166
155
@@ -369,63 +358,3 @@ func InstallGolangciLint(tb testing.TB) string {
369
358
370
359
return abs
371
360
}
372
-
373
- // TODO(ldez) remove when we will run go1.23 on the CI.
374
- func forceDisableUnsupportedLinters (args []string ) []string {
375
- result := slices .Clone (args )
376
-
377
- if ! isGoLessThan ("1.22" ) {
378
- return append (result , "--go=1.22" )
379
- }
380
-
381
- if len (result ) == 0 {
382
- return append (result , "-D" , "intrange,copyloopvar" )
383
- }
384
-
385
- if slices .ContainsFunc (args , func (arg string ) bool { return strings .HasSuffix (arg , "-disable-all" ) }) {
386
- return args
387
- }
388
-
389
- var appended bool
390
-
391
- for i , arg := range args {
392
- if ! strings .HasSuffix (arg , "-D" ) && ! strings .HasSuffix (arg , "-disable" ) {
393
- continue
394
- }
395
-
396
- if len (args ) <= i + 1 || strings .HasPrefix (args [i + 1 ], "-" ) {
397
- continue
398
- }
399
-
400
- d := strings .Split (args [i + 1 ], "," )
401
- d = append (d , "intrange" , "copyloopvar" )
402
-
403
- result [i + 1 ] = strings .Join (slices .Compact (d ), "," )
404
-
405
- appended = true
406
- break
407
- }
408
-
409
- if ! appended {
410
- result = append (result , "-D" , "intrange,copyloopvar" )
411
- }
412
-
413
- return result
414
- }
415
-
416
- // TODO(ldez) remove when we will run go1.23 on the CI.
417
- func isGoLessThan (tag string ) bool {
418
- vRuntime , err := hcversion .NewVersion (strings .TrimPrefix (runtime .Version (), "go" ))
419
- if err != nil {
420
- return false
421
- }
422
-
423
- vTag , err := hcversion .NewVersion (strings .TrimPrefix (tag , "go" ))
424
- if err != nil {
425
- return false
426
- }
427
-
428
- println (vRuntime .LessThanOrEqual (vTag ))
429
-
430
- return vRuntime .LessThan (vTag )
431
- }
0 commit comments