diff mbox series

[bug#63647,v2,1/3] guix: import: go: Sort hint about available versions.

Message ID a520128590d4b67af4c2b22ae167590b99e449dd.1685029183.git.zimon.toutoune@gmail.com
State New
Headers show
Series [bug#63647,v2,1/3] guix: import: go: Sort hint about available versions. | expand

Commit Message

Simon Tournier May 25, 2023, 3:41 p.m. UTC
* guix/import/go.scm (validate-version): Sort available versions.
 guix/import/go.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

base-commit: 99fc7e5dd3c9c92f9b6c2e51db9dc5b0481a56b2
diff mbox series


diff --git a/guix/import/go.scm b/guix/import/go.scm
index 0357e6a1eb..1943869162 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -34,6 +34,7 @@  (define-module (guix import go)
   #:use-module (guix packages)
   #:use-module (guix http-client)
   #:use-module (guix memoization)
+  #:use-module (guix utils)
   #:autoload   (htmlprag) (html->sxml)            ;from Guile-Lib
   #:autoload   (guix base32) (bytevector->nix-base32-string)
   #:autoload   (guix build utils) (mkdir-p)
@@ -588,8 +589,9 @@  (define (validate-version version available-versions module-path)
         (condition (&fix-hint
                     (hint (format #f (G_ "Pick one of the following \
 available versions:~{ ~a~}.")
-                                  (map strip-v-prefix
-                                       available-versions)))))))))
+                                  (sort (map strip-v-prefix
+                                             available-versions)
+                                        version>?)))))))))
 (define* (go-module->guix-package module-path #:key
                                   (goproxy "https://proxy.golang.org")