Skip to content

Commit 182fbce

Browse files
committed
fix: use go-cmp instead of deep equal
Signed-off-by: Charles-Edouard Brétéché <[email protected]>
1 parent bdbb290 commit 182fbce

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module github.com/jmespath-community/go-jmespath
33
go 1.18
44

55
require (
6+
github.com/google/go-cmp v0.5.8
67
github.com/spf13/cobra v1.8.0
78
github.com/stretchr/testify v1.9.0
89
golang.org/x/exp v0.0.0-20230314191032-db074128a8ec

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
22
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
33
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4+
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
5+
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
46
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
57
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
68
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=

pkg/util/util.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"math"
66
"reflect"
77

8+
"github.com/google/go-cmp/cmp"
89
"golang.org/x/exp/constraints"
910
)
1011

@@ -51,7 +52,8 @@ func IsFalse(value interface{}) bool {
5152
// It will take two arbitrary objects and recursively determine
5253
// if they are equal.
5354
func ObjsEqual(left interface{}, right interface{}) bool {
54-
return reflect.DeepEqual(left, right)
55+
return cmp.Equal(left, right)
56+
// return reflect.DeepEqual(left, right)
5557
}
5658

5759
// SliceParam refers to a single part of a slice.

0 commit comments

Comments
 (0)