fix: Replace deprecated strings.Title with cases.Title (gt-jdn2t)

Use golang.org/x/text/cases.Title(language.English) instead of the
deprecated strings.Title function. Updated formula.go (3 usages)
and patrol_helpers.go (1 usage).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
rictus
2026-01-01 19:13:53 -08:00
committed by Steve Yegge
parent 3389687dc0
commit 00999feace
4 changed files with 11 additions and 9 deletions

View File

@@ -13,6 +13,8 @@ import (
"github.com/spf13/cobra"
"github.com/steveyegge/gastown/internal/style"
"github.com/steveyegge/gastown/internal/workspace"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
// Formula command flags
@@ -745,7 +747,7 @@ func runFormulaCreate(cmd *cobra.Command, args []string) error {
func generateTaskTemplate(name string) string {
// Sanitize name for use in template
title := strings.ReplaceAll(name, "-", " ")
title = strings.Title(title)
title = cases.Title(language.English).String(title)
return fmt.Sprintf(`# Formula: %s
# Type: task
@@ -784,7 +786,7 @@ Perform the main task work.
func generateWorkflowTemplate(name string) string {
title := strings.ReplaceAll(name, "-", " ")
title = strings.Title(title)
title = cases.Title(language.English).String(title)
return fmt.Sprintf(`# Formula: %s
# Type: workflow
@@ -859,7 +861,7 @@ required = true
func generatePatrolTemplate(name string) string {
title := strings.ReplaceAll(name, "-", " ")
title = strings.Title(title)
title = cases.Title(language.English).String(title)
return fmt.Sprintf(`# Formula: %s
# Type: patrol

View File

@@ -8,6 +8,8 @@ import (
"strings"
"github.com/steveyegge/gastown/internal/style"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
// PatrolConfig holds role-specific patrol configuration.
@@ -207,7 +209,7 @@ func outputPatrolContext(cfg PatrolConfig) {
}
// Show patrol work loop instructions
fmt.Printf("**%s Patrol Work Loop:**\n", strings.Title(cfg.RoleName))
fmt.Printf("**%s Patrol Work Loop:**\n", cases.Title(language.English).String(cfg.RoleName))
for i, step := range cfg.WorkLoopSteps {
fmt.Printf("%d. %s\n", i+1, step)
}