From cc09616a3e3ef2ba30c78170f87c7d9418258123 Mon Sep 17 00:00:00 2001 From: Aaron Chen Date: Sat, 20 Apr 2024 23:00:41 +0800 Subject: [PATCH] build: fix string compare for SortFunc --- 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 58e8b16045c6..f548a5995b72 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)