Skip to content

Commit 4004c09

Browse files
authored
Merge branch 'master' into patch-1
2 parents f6c8b41 + 8d9dc66 commit 4004c09

File tree

8 files changed

+102
-155
lines changed

8 files changed

+102
-155
lines changed

.github/workflows/build-test-workflow.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/setup-go@v4
12+
- uses: actions/setup-go@v5
1313
with:
14-
go-version: '1.20'
15-
- uses: actions/checkout@v3
14+
go-version: '1.24'
15+
- uses: actions/checkout@v4
1616
- name: Fetching dependencies
1717
run : go get -v -t -d ./...
1818
- name: Execute test

examples/ItemArrayExample_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ func TestItemPriceChecker_TestLexer(t *testing.T) {
196196
if nt.GetTokenType() == antlr.TokenEOF {
197197
break
198198
}
199-
t.Logf(nt.GetText())
199+
t.Logf("%s", nt.GetText())
200200
}
201201
}
202202

go.mod

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,42 @@
11
module github.com/hyperjumptech/grule-rule-engine
22

3-
go 1.20
3+
go 1.24.4
44

55
require (
66
github.com/antlr/antlr4/runtime/Go/antlr v1.4.10
77
github.com/bmatcuk/doublestar v1.3.4
8-
github.com/go-git/go-billy/v5 v5.5.0
9-
github.com/go-git/go-git/v5 v5.11.0
10-
github.com/google/uuid v1.3.0
8+
github.com/go-git/go-billy/v5 v5.6.2
9+
github.com/go-git/go-git/v5 v5.16.2
10+
github.com/google/uuid v1.6.0
1111
github.com/hyperjumptech/hyper-mux v1.1.0
1212
github.com/sirupsen/logrus v1.9.3
13-
github.com/stretchr/testify v1.8.4
14-
go.uber.org/zap v1.25.0
15-
gopkg.in/src-d/go-billy.v4 v4.3.2
13+
github.com/stretchr/testify v1.10.0
14+
go.uber.org/zap v1.27.0
1615
)
1716

1817
require (
19-
dario.cat/mergo v1.0.0 // indirect
20-
github.com/Microsoft/go-winio v0.6.1 // indirect
18+
dario.cat/mergo v1.0.2 // indirect
19+
github.com/Microsoft/go-winio v0.6.2 // indirect
2120
github.com/NYTimes/gziphandler v1.1.1 // indirect
22-
github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect
23-
github.com/cloudflare/circl v1.3.3 // indirect
24-
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
21+
github.com/ProtonMail/go-crypto v1.3.0 // indirect
22+
github.com/cloudflare/circl v1.6.1 // indirect
23+
github.com/cyphar/filepath-securejoin v0.4.1 // indirect
2524
github.com/davecgh/go-spew v1.1.1 // indirect
2625
github.com/emirpasic/gods v1.18.1 // indirect
2726
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
28-
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
27+
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
2928
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
3029
github.com/kevinburke/ssh_config v1.2.0 // indirect
31-
github.com/pjbgf/sha1cd v0.3.0 // indirect
30+
github.com/pjbgf/sha1cd v0.3.2 // indirect
3231
github.com/pmezard/go-difflib v1.0.0 // indirect
33-
github.com/rs/cors v1.8.0 // indirect
34-
github.com/sergi/go-diff v1.1.0 // indirect
35-
github.com/skeema/knownhosts v1.2.1 // indirect
32+
github.com/rs/cors v1.11.1 // indirect
33+
github.com/sergi/go-diff v1.4.0 // indirect
34+
github.com/skeema/knownhosts v1.3.1 // indirect
3635
github.com/xanzy/ssh-agent v0.3.3 // indirect
37-
go.uber.org/multierr v1.10.0 // indirect
38-
golang.org/x/crypto v0.18.0 // indirect
39-
golang.org/x/mod v0.12.0 // indirect
40-
golang.org/x/net v0.19.0 // indirect
41-
golang.org/x/sys v0.16.0 // indirect
42-
golang.org/x/tools v0.13.0 // indirect
36+
go.uber.org/multierr v1.11.0 // indirect
37+
golang.org/x/crypto v0.39.0 // indirect
38+
golang.org/x/net v0.41.0 // indirect
39+
golang.org/x/sys v0.33.0 // indirect
4340
gopkg.in/warnings.v0 v0.1.2 // indirect
4441
gopkg.in/yaml.v3 v3.0.1 // indirect
4542
)

go.sum

Lines changed: 63 additions & 113 deletions
Large diffs are not rendered by default.

model/GoDataAccessLayer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ func TestGoValueNode_Map(t *testing.T) {
202202
childrenChristenNode, err := childrenNode.GetChildNodeBySelector(reflect.ValueOf("Christen"))
203203
assert.NoError(t, err)
204204
assert.True(t, childrenChristenNode.IsObject())
205-
t.Logf(childrenChristenNode.IdentifiedAs())
205+
t.Logf("%s", childrenChristenNode.IdentifiedAs())
206206
}
207207

208208
func TestGoValueNode_Array_Set(t *testing.T) {

pkg/JsonResource.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ func buildExpressionEx(input map[string]interface{}, depth int) (string, bool, e
362362
return "", false, fmt.Errorf("constant must be a string or a numeric value")
363363
default:
364364

365-
return "", false, fmt.Errorf("unknown operator type: " + key)
365+
return "", false, fmt.Errorf("unknown operator type: %s", key)
366366
}
367367
}
368368

pkg/jsontool/JsonDom_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func TestJsonNodeOperations(t *testing.T) {
188188
}
189189
s, err := jdata.GetString("fullname")
190190
if err != nil {
191-
t.Errorf(err.Error())
191+
t.Errorf("%v", err.Error())
192192
}
193193
if s != "Bruce Wayne" {
194194
t.Logf("fail validate full name")
@@ -214,7 +214,7 @@ func TestJsonNodeOperations(t *testing.T) {
214214
}
215215
i, err := jdata.GetInt("age")
216216
if err != nil {
217-
t.Errorf(err.Error())
217+
t.Errorf("%v", err.Error())
218218
}
219219
if i != 35 {
220220
t.Logf("fail validate age")
@@ -252,7 +252,7 @@ func TestJsonNodeOperations(t *testing.T) {
252252

253253
m, err := jdata.IsMap("address")
254254
if err != nil {
255-
t.Errorf(err.Error())
255+
t.Errorf("%v", err.Error())
256256
}
257257
if !m {
258258
t.Logf("address is a map")
@@ -261,7 +261,7 @@ func TestJsonNodeOperations(t *testing.T) {
261261

262262
s, err = jdata.GetString("address.street1")
263263
if err != nil {
264-
t.Errorf(err.Error())
264+
t.Errorf("%v", err.Error())
265265
}
266266
if s != "Super Mansion" {
267267
t.Logf("fail validate address.street1")
@@ -283,7 +283,7 @@ func TestJsonNodeOperations(t *testing.T) {
283283
}
284284
b, err := jdata.IsArray("friends")
285285
if err != nil {
286-
t.Errorf(err.Error())
286+
t.Errorf("%v", err.Error())
287287
}
288288
if !b {
289289
t.Logf("fail validate friends as array")
@@ -312,7 +312,7 @@ func TestJsonNodeOperations(t *testing.T) {
312312
}
313313
b, err = jdata.IsString("friends[1].fullname")
314314
if err != nil {
315-
t.Errorf(err.Error())
315+
t.Errorf("%v", err.Error())
316316
}
317317
if !b {
318318
t.Logf("fail validate friends[1].fullname type")
@@ -345,7 +345,7 @@ func TestJsonNodeOperations(t *testing.T) {
345345
}
346346
str, err = jdata.GetString("friends[1].fullname")
347347
if err != nil {
348-
t.Errorf(err.Error())
348+
t.Errorf("%v", err.Error())
349349
}
350350
if str != "Lara Croft" {
351351
t.Logf("fail validate friends[1].fullname value")

pkg/reflectmath_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,47 +130,47 @@ func TestStringComparison(t *testing.T) {
130130
for i, v := range StrCompareTest {
131131
val, err := EvaluateEqual(reflect.ValueOf(v.A), reflect.ValueOf(v.B))
132132
if err != nil {
133-
t.Errorf(err.Error())
133+
t.Errorf("%s", err.Error())
134134
t.Fail()
135135
} else if val.Bool() != v.Eq {
136136
t.Errorf("%d Expect \"%s\" and \"%s\" EQ expect %v but %v", i, v.A, v.B, v.Eq, !v.Eq)
137137
}
138138

139139
val, err = EvaluateNotEqual(reflect.ValueOf(v.A), reflect.ValueOf(v.B))
140140
if err != nil {
141-
t.Errorf(err.Error())
141+
t.Errorf("%s", err.Error())
142142
t.Fail()
143143
} else if val.Bool() != v.Neq {
144144
t.Errorf("%d Expect \"%s\" and \"%s\" NEQ expect %v but %v", i, v.A, v.B, v.Neq, !v.Neq)
145145
}
146146

147147
val, err = EvaluateGreaterThan(reflect.ValueOf(v.A), reflect.ValueOf(v.B))
148148
if err != nil {
149-
t.Errorf(err.Error())
149+
t.Errorf("%s", err.Error())
150150
t.Fail()
151151
} else if val.Bool() != v.Gt {
152152
t.Errorf("%d Expect \"%s\" and \"%s\" GT expect %v but %v", i, v.A, v.B, v.Gt, !v.Gt)
153153
}
154154

155155
val, err = EvaluateGreaterThanEqual(reflect.ValueOf(v.A), reflect.ValueOf(v.B))
156156
if err != nil {
157-
t.Errorf(err.Error())
157+
t.Errorf("%s", err.Error())
158158
t.Fail()
159159
} else if val.Bool() != v.Gte {
160160
t.Errorf("%d Expect \"%s\" and \"%s\" GTE expect %v but %v", i, v.A, v.B, v.Gte, !v.Gte)
161161
}
162162

163163
val, err = EvaluateLesserThan(reflect.ValueOf(v.A), reflect.ValueOf(v.B))
164164
if err != nil {
165-
t.Errorf(err.Error())
165+
t.Errorf("%s", err.Error())
166166
t.Fail()
167167
} else if val.Bool() != v.Lt {
168168
t.Errorf("%d Expect \"%s\" and \"%s\" LT expect %v but %v", i, v.A, v.B, v.Lt, !v.Lt)
169169
}
170170

171171
val, err = EvaluateLesserThanEqual(reflect.ValueOf(v.A), reflect.ValueOf(v.B))
172172
if err != nil {
173-
t.Errorf(err.Error())
173+
t.Errorf("%s", err.Error())
174174
t.Fail()
175175
} else if val.Bool() != v.Lte {
176176
t.Errorf("%d Expect \"%s\" and \"%s\" LTE expect %v but %v", i, v.A, v.B, v.Lte, !v.Lte)

0 commit comments

Comments
 (0)