ci: add Go 1.23/1.24 testing and fix example test names (#760)

Expand test coverage to newer Go versions and fix compatibility issues:

- Add Go 1.23 and 1.24 to test matrix in test.yml
- Add Go 1.24 to build matrix in build.yml
- Fix example test names to match Go conventions:
  * ExampleOperator_Decimal → ExampleOperator_with_decimal
  * ExampleWithTimezone → ExampleTimezone
  * ExampleGetUnifiedDiffCode → ExampleGetUnifiedDiffString
  * ExampleGetContextDiffCode → ExampleGetContextDiffString
  * ExampleGetContextDiffString → ExampleGetContextDiffString_second

These changes maintain compatibility with Go 1.18 (as specified in
go.mod) while ensuring the codebase works correctly with the latest
Go versions, which enforce stricter naming conventions for example
tests.

Signed-off-by: Ville Vesilehto <[email protected]>
Co-authored-by: Anton Medvedev <[email protected]>
This commit is contained in:
Ville Vesilehto
2025-03-02 09:31:59 +01:00
committed by GitHub
co-authored by Anton Medvedev
parent b7e7d82692
commit 96320d0603
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-versions: [ '1.18', '1.22' ]
go-versions: [ '1.18', '1.22', '1.24' ]
go-arch: [ '386' ]
steps:
- uses: actions/checkout@v3
+1 -1
View File
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-versions: [ '1.18', '1.19', '1.20', '1.21', '1.22' ]
go-versions: [ '1.18', '1.19', '1.20', '1.21', '1.22', '1.23', '1.24' ]
steps:
- uses: actions/checkout@v3
- name: Setup Go ${{ matrix.go-version }}
+2 -2
View File
@@ -312,7 +312,7 @@ func ExampleOperator() {
// Output: true
}
func ExampleOperator_Decimal() {
func ExampleOperator_with_decimal() {
type Decimal struct{ N float64 }
code := `A + B - C`
@@ -585,7 +585,7 @@ func ExampleWithContext() {
// Output: 42
}
func ExampleWithTimezone() {
func ExampleTimezone() {
program, err := expr.Compile(`now().Location().String()`, expr.Timezone("Asia/Kamchatka"))
if err != nil {
fmt.Printf("%v", err)
+3 -3
View File
@@ -102,7 +102,7 @@ group
}
}
func ExampleGetUnifiedDiffCode() {
func ExampleGetUnifiedDiffString() {
a := `one
two
three
@@ -135,7 +135,7 @@ four`
// -fmt.Printf("%s,%T",a,b)
}
func ExampleGetContextDiffCode() {
func ExampleGetContextDiffString() {
a := `one
two
three
@@ -172,7 +172,7 @@ four`
// four
}
func ExampleGetContextDiffString() {
func ExampleGetContextDiffString_second() {
a := `one
two
three