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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
102 changed files with 322 additions and 352 deletions

View file

@ -65,8 +65,8 @@ func (ic *IgnoreChecker) PushAllParents(ctx context.Context, targetPath string)
// Load patterns for each parent directory
currentPath := "."
parts := strings.Split(path.Clean(targetPath), "/")
for _, part := range parts {
parts := strings.SplitSeq(path.Clean(targetPath), "/")
for part := range parts {
if part == "." || part == "" {
continue
}

View file

@ -215,8 +215,8 @@ func (t Tags) Lyrics() string {
}
for tag, value := range t.Tags {
if strings.HasPrefix(tag, "lyrics-") {
language := strings.TrimSpace(strings.TrimPrefix(tag, "lyrics-"))
if after, ok := strings.CutPrefix(tag, "lyrics-"); ok {
language := strings.TrimSpace(after)
if language == "" {
language = "xxx"