build: fix string compare for SortFunc

This commit is contained in:
Aaron Chen 2024-04-20 23:00:41 +08:00 committed by GitHub
parent 2e06fbd409
commit cc09616a3e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)