From 96c1fc6a2be0cf4dc39d93bfc7f8df0cd76a7b14 Mon Sep 17 00:00:00 2001 From: Kiran Kamineni Date: Fri, 18 Jan 2019 16:54:25 -0800 Subject: Fix sorting with right index value Fix the less function used in sort.Slice with the right index. I am using the same index which obviously will not work. Issue-ID: MULTICLOUD-439 Change-Id: Ibb78c03d67cf59e3941acc786796d0cc69b4f0aa Signed-off-by: Kiran Kamineni --- src/k8splugin/rb/profile_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/k8splugin/rb/profile_test.go') diff --git a/src/k8splugin/rb/profile_test.go b/src/k8splugin/rb/profile_test.go index a760830b..26b9747c 100644 --- a/src/k8splugin/rb/profile_test.go +++ b/src/k8splugin/rb/profile_test.go @@ -150,12 +150,12 @@ func TestListProfiles(t *testing.T) { // Since the order of returned slice is not guaranteed // Check both and return error if both don't match sort.Slice(got, func(i, j int) bool { - return got[i].UUID < got[i].UUID + return got[i].UUID < got[j].UUID }) // Sort both as it is not expected that testCase.expected // is sorted sort.Slice(testCase.expected, func(i, j int) bool { - return testCase.expected[i].UUID < testCase.expected[i].UUID + return testCase.expected[i].UUID < testCase.expected[j].UUID }) if reflect.DeepEqual(testCase.expected, got) == false { -- cgit 1.2.3-korg