-
Notifications
You must be signed in to change notification settings - Fork 155
Open
Labels
component/schedulingArmada Server, Scheduler and Scheduler InjesterArmada Server, Scheduler and Scheduler Injestergood first issueGood for newcomersGood for newcomerslanguage/goPull requests that update Go codePull requests that update Go code
Description
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.Titleimport remains go test ./internal/scheduler/...passesgolangci-lint run ./internal/scheduler/...passes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
component/schedulingArmada Server, Scheduler and Scheduler InjesterArmada Server, Scheduler and Scheduler Injestergood first issueGood for newcomersGood for newcomerslanguage/goPull requests that update Go codePull requests that update Go code