From 63a73a98528c24a0041066df0246c0218945361a Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Feb 2026 16:25:54 +0000 Subject: [PATCH] =?UTF-8?q?chore:=20sort.Slice=20=E2=86=92=20slices.SortFu?= =?UTF-8?q?nc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 --- cmd/pkgcmd/cmd_search.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/pkgcmd/cmd_search.go b/cmd/pkgcmd/cmd_search.go index 7da952b0..e0e087a5 100644 --- a/cmd/pkgcmd/cmd_search.go +++ b/cmd/pkgcmd/cmd_search.go @@ -1,13 +1,14 @@ package pkgcmd import ( + "cmp" "encoding/json" "errors" "fmt" "os" "os/exec" "path/filepath" - "sort" + "slices" "strings" "time" @@ -147,8 +148,8 @@ func runPkgSearch(org, pattern, repoType string, limit int, refresh bool) error return nil } - sort.Slice(filtered, func(i, j int) bool { - return filtered[i].Name < filtered[j].Name + slices.SortFunc(filtered, func(a, b ghRepo) int { + return cmp.Compare(a.Name, b.Name) }) fmt.Print(i18n.T("cmd.pkg.search.found_repos", map[string]int{"Count": len(filtered)}) + "\n\n")