refactor: run Go modernize (#5002)

This commit is contained in:
Maximilian
2026-02-08 08:57:30 -06:00
committed by GitHub
parent 408aa78ed5
commit a704e86ac1
102 changed files with 322 additions and 352 deletions
+2 -2
View File
@@ -54,8 +54,8 @@ func SanitizeFieldForSortingNoArticle(originalValue string) string {
}
func RemoveArticle(name string) string {
articles := strings.Split(conf.Server.IgnoredArticles, " ")
for _, a := range articles {
articles := strings.SplitSeq(conf.Server.IgnoredArticles, " ")
for a := range articles {
n := strings.TrimPrefix(name, a+" ")
if n != name {
return n
+1 -4
View File
@@ -50,10 +50,7 @@ func TruncateRunes(s string, maxRunes int, suffix string) string {
}
suffixRunes := utf8.RuneCountInString(suffix)
truncateAt := maxRunes - suffixRunes
if truncateAt < 0 {
truncateAt = 0
}
truncateAt := max(maxRunes-suffixRunes, 0)
runes := []rune(s)
if truncateAt >= len(runes) {