Skip to content

Commit 77e876b

Browse files
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]>
1 parent 8228148 commit 77e876b

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
go-versions: [ '1.18', '1.22' ]
14+
go-versions: [ '1.18', '1.22', '1.24' ]
1515
go-arch: [ '386' ]
1616
steps:
1717
- uses: actions/checkout@v3

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
go-versions: [ '1.18', '1.19', '1.20', '1.21', '1.22' ]
14+
go-versions: [ '1.18', '1.19', '1.20', '1.21', '1.22', '1.23', '1.24' ]
1515
steps:
1616
- uses: actions/checkout@v3
1717
- name: Setup Go ${{ matrix.go-version }}

expr_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ func ExampleOperator() {
312312
// Output: true
313313
}
314314

315-
func ExampleOperator_Decimal() {
315+
func ExampleOperator_with_decimal() {
316316
type Decimal struct{ N float64 }
317317
code := `A + B - C`
318318

@@ -585,7 +585,7 @@ func ExampleWithContext() {
585585
// Output: 42
586586
}
587587

588-
func ExampleWithTimezone() {
588+
func ExampleTimezone() {
589589
program, err := expr.Compile(`now().Location().String()`, expr.Timezone("Asia/Kamchatka"))
590590
if err != nil {
591591
fmt.Printf("%v", err)

internal/difflib/difflib_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ group
102102
}
103103
}
104104

105-
func ExampleGetUnifiedDiffCode() {
105+
func ExampleGetUnifiedDiffString() {
106106
a := `one
107107
two
108108
three
@@ -135,7 +135,7 @@ four`
135135
// -fmt.Printf("%s,%T",a,b)
136136
}
137137

138-
func ExampleGetContextDiffCode() {
138+
func ExampleGetContextDiffString() {
139139
a := `one
140140
two
141141
three
@@ -172,7 +172,7 @@ four`
172172
// four
173173
}
174174

175-
func ExampleGetContextDiffString() {
175+
func ExampleGetContextDiffString_second() {
176176
a := `one
177177
two
178178
three

0 commit comments

Comments
 (0)