From 8822bb11ce9da7891045c9bbdefe5c69c63323cc Mon Sep 17 00:00:00 2001 From: Laura Cressman Date: Mon, 4 Sep 2017 13:48:09 -0400 Subject: [PATCH] routing: replace sort.Sort with sort.Slice in heap_test.go Use sort.Slice in TestHeapOrdering function in routing/heap_test.go, as part of the move to use new language features. --- routing/heap_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routing/heap_test.go b/routing/heap_test.go index 56df7666..2aa3ba48 100644 --- a/routing/heap_test.go +++ b/routing/heap_test.go @@ -35,7 +35,9 @@ func TestHeapOrdering(t *testing.T) { // Sort the regular slice, we'll compare this against all the entries // popped from the heap. - sort.Sort(&distanceHeap{sortedEntries}) + sort.Slice(sortedEntries, func(i, j int) bool { + return sortedEntries[i].dist < sortedEntries[j].dist + }) // One by one, pop of all the entries from the heap, they should come // out in sorted order.