Skip to content

Commit

Permalink
fix: tests runner
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Feb 17, 2024
1 parent 3e50805 commit 51563ef
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/testshared/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ func InstallGolangciLint(tb testing.TB) string {

// TODO(ldez) remove when we will run go1.23 on the CI.
func forceDisableUnsupportedLinters(args []string) []string {
if !isGoVersion("1.21") {
if !isGoLessThan("1.22") {
return args
}

Expand Down Expand Up @@ -414,7 +414,7 @@ func forceDisableUnsupportedLinters(args []string) []string {
}

// TODO(ldez) remove when we will run go1.23 on the CI.
func isGoVersion(tag string) bool {
func isGoLessThan(tag string) bool {
vRuntime, err := hcversion.NewVersion(strings.TrimPrefix(runtime.Version(), "go"))
if err != nil {
return false
Expand All @@ -425,5 +425,7 @@ func isGoVersion(tag string) bool {
return false
}

return vRuntime.GreaterThanOrEqual(vTag)
println(vRuntime.LessThanOrEqual(vTag))

return vRuntime.LessThan(vTag)
}

0 comments on commit 51563ef

Please sign in to comment.