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:
@@ -3,14 +3,16 @@ module github.com/steveyegge/gastown
|
|||||||
go 1.24.0
|
go 1.24.0
|
||||||
|
|
||||||
require (
|
require (
|
||||||
|
github.com/BurntSushi/toml v1.6.0
|
||||||
github.com/charmbracelet/bubbles v0.21.0
|
github.com/charmbracelet/bubbles v0.21.0
|
||||||
github.com/charmbracelet/bubbletea v1.3.10
|
github.com/charmbracelet/bubbletea v1.3.10
|
||||||
github.com/charmbracelet/lipgloss v1.1.0
|
github.com/charmbracelet/lipgloss v1.1.0
|
||||||
github.com/spf13/cobra v1.8.1
|
github.com/spf13/cobra v1.8.1
|
||||||
|
golang.org/x/term v0.38.0
|
||||||
|
golang.org/x/text v0.3.8
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/BurntSushi/toml v1.6.0 // indirect
|
|
||||||
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
|
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
|
||||||
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
|
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
|
||||||
github.com/charmbracelet/x/ansi v0.10.1 // indirect
|
github.com/charmbracelet/x/ansi v0.10.1 // indirect
|
||||||
@@ -29,6 +31,4 @@ require (
|
|||||||
github.com/spf13/pflag v1.0.5 // indirect
|
github.com/spf13/pflag v1.0.5 // indirect
|
||||||
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
|
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
|
||||||
golang.org/x/sys v0.39.0 // indirect
|
golang.org/x/sys v0.39.0 // indirect
|
||||||
golang.org/x/term v0.38.0 // indirect
|
|
||||||
golang.org/x/text v0.3.8 // indirect
|
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -53,8 +53,6 @@ golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561 h1:MDc5xs78ZrZr3HMQugiXOAkSZ
|
|||||||
golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
|
golang.org/x/exp v0.0.0-20220909182711-5c715a9e8561/go.mod h1:cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
|
||||||
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
|
|
||||||
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
|
||||||
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
|
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
|
||||||
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
|
||||||
golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q=
|
golang.org/x/term v0.38.0 h1:PQ5pkm/rLO6HnxFR7N2lJHOZX6Kez5Y1gDSJla6jo7Q=
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/steveyegge/gastown/internal/style"
|
"github.com/steveyegge/gastown/internal/style"
|
||||||
"github.com/steveyegge/gastown/internal/workspace"
|
"github.com/steveyegge/gastown/internal/workspace"
|
||||||
|
"golang.org/x/text/cases"
|
||||||
|
"golang.org/x/text/language"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Formula command flags
|
// Formula command flags
|
||||||
@@ -745,7 +747,7 @@ func runFormulaCreate(cmd *cobra.Command, args []string) error {
|
|||||||
func generateTaskTemplate(name string) string {
|
func generateTaskTemplate(name string) string {
|
||||||
// Sanitize name for use in template
|
// Sanitize name for use in template
|
||||||
title := strings.ReplaceAll(name, "-", " ")
|
title := strings.ReplaceAll(name, "-", " ")
|
||||||
title = strings.Title(title)
|
title = cases.Title(language.English).String(title)
|
||||||
|
|
||||||
return fmt.Sprintf(`# Formula: %s
|
return fmt.Sprintf(`# Formula: %s
|
||||||
# Type: task
|
# Type: task
|
||||||
@@ -784,7 +786,7 @@ Perform the main task work.
|
|||||||
|
|
||||||
func generateWorkflowTemplate(name string) string {
|
func generateWorkflowTemplate(name string) string {
|
||||||
title := strings.ReplaceAll(name, "-", " ")
|
title := strings.ReplaceAll(name, "-", " ")
|
||||||
title = strings.Title(title)
|
title = cases.Title(language.English).String(title)
|
||||||
|
|
||||||
return fmt.Sprintf(`# Formula: %s
|
return fmt.Sprintf(`# Formula: %s
|
||||||
# Type: workflow
|
# Type: workflow
|
||||||
@@ -859,7 +861,7 @@ required = true
|
|||||||
|
|
||||||
func generatePatrolTemplate(name string) string {
|
func generatePatrolTemplate(name string) string {
|
||||||
title := strings.ReplaceAll(name, "-", " ")
|
title := strings.ReplaceAll(name, "-", " ")
|
||||||
title = strings.Title(title)
|
title = cases.Title(language.English).String(title)
|
||||||
|
|
||||||
return fmt.Sprintf(`# Formula: %s
|
return fmt.Sprintf(`# Formula: %s
|
||||||
# Type: patrol
|
# Type: patrol
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/steveyegge/gastown/internal/style"
|
"github.com/steveyegge/gastown/internal/style"
|
||||||
|
"golang.org/x/text/cases"
|
||||||
|
"golang.org/x/text/language"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PatrolConfig holds role-specific patrol configuration.
|
// PatrolConfig holds role-specific patrol configuration.
|
||||||
@@ -207,7 +209,7 @@ func outputPatrolContext(cfg PatrolConfig) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show patrol work loop instructions
|
// 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 {
|
for i, step := range cfg.WorkLoopSteps {
|
||||||
fmt.Printf("%d. %s\n", i+1, step)
|
fmt.Printf("%d. %s\n", i+1, step)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user