From a327711508bf71297745c3ed2da40c0724d11f67 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Sun, 27 Oct 2024 12:46:22 +0100 Subject: [PATCH] Fix building of galenectl with Go 1.20. Package slices doesn't exist in 1.20. --- galenectl/galenectl.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/galenectl/galenectl.go b/galenectl/galenectl.go index 6554cdf..7f868c8 100644 --- a/galenectl/galenectl.go +++ b/galenectl/galenectl.go @@ -15,7 +15,7 @@ import ( "net/url" "os" "path/filepath" - "slices" + "sort" "strings" "time" @@ -115,7 +115,9 @@ func main() { for name := range commands { names = append(names, name) } - slices.Sort(names) + sort.Slice(names, func(i, j int) bool { + return names[i] < names[j] + }) for _, name := range names { fmt.Fprintf( flag.CommandLine.Output(),