From 1daad3d1a436641f1bab29f5fcfe8a82b8506ba3 Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Fri, 26 Jun 2020 18:30:41 +0200 Subject: [PATCH] Ugly fix is ugly --- go/tests/prog/reverserange_prog/main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/go/tests/prog/reverserange_prog/main.go b/go/tests/prog/reverserange_prog/main.go index 05a7cbec9..6706a76e7 100644 --- a/go/tests/prog/reverserange_prog/main.go +++ b/go/tests/prog/reverserange_prog/main.go @@ -3,6 +3,7 @@ package main import ( "fmt" "os" + "sort" "strconv" "lib" @@ -22,7 +23,9 @@ func main() { fmt.Println(err) return } - for _, i := range lib.IntRange(b, a) { + suite := lib.IntRange(a, b) + sort.Sort(sort.Reverse(sort.IntSlice(suite))) + for _, i := range suite { fmt.Print(i) } fmt.Println()