From 28ccb2bbf82af487da856d459d4daaa7c0d9b064 Mon Sep 17 00:00:00 2001 From: Aaron Chen Date: Sun, 21 Apr 2024 17:14:13 +0800 Subject: [PATCH] build: fix string compare for SortFunc (#29595) --- build/update-license.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/update-license.go b/build/update-license.go index 58e8b16045..f548a5995b 100644 --- a/build/update-license.go +++ b/build/update-license.go @@ -291,8 +291,8 @@ func writeAuthors(files []string) { } } // Write sorted list of authors back to the file. - slices.SortFunc(list, func(a, b string) bool { - return strings.ToLower(a) < strings.ToLower(b) + slices.SortFunc(list, func(a, b string) int { + return strings.Compare(strings.ToLower(a), strings.ToLower(b)) }) content := new(bytes.Buffer) content.WriteString(authorsFileHeader)