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 <noreply@anthropic.com>
This commit is contained in:
parent
42789ffd0f
commit
f074d71cf9
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user