Is your feature request related to a problem? Please describe.
strings.Title() is deprecated since Go 1.18 and we still use it in two places in the scheduler metrics code.
Describe the solution you'd like
Replace both calls with cases.Title(language.English).String(...) from golang.org/x/text/cases and golang.org/x/text/language.
Files to change
internal/scheduler/metrics.go:484 - strings.Title(strings.ToLower(phase))
internal/scheduler/metrics.go:493 - strings.Title(strings.ToLower(phase))
Example
// Before
phase: strings.Title(strings.ToLower(phase)),
// After
phase: cases.Title(language.English).String(strings.ToLower(phase)),
The cases.Title caser is safe for concurrent use, so you can create it once as a package-level variable rather than creating a new one on every call.
Acceptance criteria
- Both
strings.Title() calls replaced
- No
strings.Title import remains
go test ./internal/scheduler/... passes
golangci-lint run ./internal/scheduler/... passes
Is your feature request related to a problem? Please describe.
strings.Title()is deprecated since Go 1.18 and we still use it in two places in the scheduler metrics code.Describe the solution you'd like
Replace both calls with
cases.Title(language.English).String(...)fromgolang.org/x/text/casesandgolang.org/x/text/language.Files to change
internal/scheduler/metrics.go:484-strings.Title(strings.ToLower(phase))internal/scheduler/metrics.go:493-strings.Title(strings.ToLower(phase))Example
The
cases.Titlecaser is safe for concurrent use, so you can create it once as a package-level variable rather than creating a new one on every call.Acceptance criteria
strings.Title()calls replacedstrings.Titleimport remainsgo test ./internal/scheduler/...passesgolangci-lint run ./internal/scheduler/...passes