Clean up methods

This commit is contained in:
idanoo 2023-01-30 11:57:55 +13:00
parent a2a5a26e0f
commit dcbef8eb1f
Signed by: idanoo
GPG key ID: 387387CDBC02F132
3 changed files with 8 additions and 1 deletions

View file

@ -6,6 +6,7 @@ import (
"time"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)
// Stores out metric/row data
@ -116,5 +117,8 @@ func getUserCounts() ([]metric, error) {
}
func getPrintableString(m metric) string {
return fmt.Sprintf("%s: %d", cases.Title(m.Service), m.MetricValue)
caser := cases.Title(language.English)
titleStr := caser.String(m.Service)
return fmt.Sprintf("%s: %d", titleStr, m.MetricValue)
}