From f074d71cf9bd9a6d94384f5205a59de9b8876740 Mon Sep 17 00:00:00 2001 From: Alex Dunmow Date: Tue, 7 Jul 2026 12:46:02 +0800 Subject: [PATCH] chore(theme): modernize strings.Split to SplitSeq Convert two loops in the theme command from strings.Split() to strings.SplitSeq() for more efficient iteration using Go 1.24+ iterators. This is a mechanical modernization with identical behavior. Co-Authored-By: Claude Fable 5 --- cmd/ninja/cmd/theme.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/ninja/cmd/theme.go b/cmd/ninja/cmd/theme.go index 437c67f..af7f946 100644 --- a/cmd/ninja/cmd/theme.go +++ b/cmd/ninja/cmd/theme.go @@ -115,7 +115,7 @@ the rest of the CLI.`, return fmt.Errorf("create %s: %w", screenshotsDir, err) } n := 0 - for _, pageSlug := range strings.Split(pages, ",") { + for pageSlug := range strings.SplitSeq(pages, ",") { pageSlug = strings.TrimSpace(pageSlug) if pageSlug == "" { continue @@ -176,7 +176,7 @@ func parseModes(modes string) ([]string, error) { return []string{""}, nil } var out []string - for _, m := range strings.Split(modes, ",") { + for m := range strings.SplitSeq(modes, ",") { m = strings.TrimSpace(m) if m != "light" && m != "dark" { return nil, fmt.Errorf("--modes: %q is not a valid mode (want light or dark)", m)