From 0967e5c5140429390da53578e2e10e01cdc0606e Mon Sep 17 00:00:00 2001 From: infiniteoverflow Date: Sat, 3 Oct 2020 11:18:25 +0530 Subject: [PATCH 1/2] Replace reflect.DeepEqual() with github.com/google/go-cmp/cmp --- pkg/migrate/cstor/cspc_generator_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/migrate/cstor/cspc_generator_test.go b/pkg/migrate/cstor/cspc_generator_test.go index cbd2f773..f5f5d9a0 100644 --- a/pkg/migrate/cstor/cspc_generator_test.go +++ b/pkg/migrate/cstor/cspc_generator_test.go @@ -184,7 +184,7 @@ func Test_getDataRaidGroups(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := getDataRaidGroups(tt.args.cspObj); !reflect.DeepEqual(got, tt.want) { + if got := getDataRaidGroups(tt.args.cspObj); !cmp.Equal(got, tt.want) { t.Errorf("getDataRaidGroups() = %v, want %v", got, tt.want) } }) From f4918562ccec8d86fc577b6754e01879ea246b75 Mon Sep 17 00:00:00 2001 From: Aswin Gopinathan <40236624+infiniteoverflow@users.noreply.github.com> Date: Sat, 3 Oct 2020 13:30:23 +0530 Subject: [PATCH 2/2] Update cspc_generator_test.go Added import to "github.com/google/go-cmp/cmp" and removed reflect --- pkg/migrate/cstor/cspc_generator_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/migrate/cstor/cspc_generator_test.go b/pkg/migrate/cstor/cspc_generator_test.go index f5f5d9a0..262c3683 100644 --- a/pkg/migrate/cstor/cspc_generator_test.go +++ b/pkg/migrate/cstor/cspc_generator_test.go @@ -17,9 +17,9 @@ limitations under the License. package migrate import ( - "reflect" "testing" - + + "github.com/google/go-cmp/cmp" cstor "github.com/openebs/api/pkg/apis/cstor/v1" apis "github.com/openebs/maya/pkg/apis/openebs.io/v1alpha1" )