Skip to content

Commit 131449a

Browse files
author
Daniils Petrovs
committed
Fix deprecated usage of Title()
1 parent b2a90d5 commit 131449a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/utils/utils.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88

99
"github.com/platogo/zube"
1010
"github.com/spf13/pflag"
11+
"golang.org/x/text/cases"
12+
"golang.org/x/text/language"
1113
)
1214

1315
// Returns a string truncated to the given `maxLen`
@@ -31,7 +33,7 @@ func TruncateString(s string, maxLen int) string {
3133
// Converts a snake case string (e.g. `in_progress`) to title case (e.g. `In Progress`)
3234
func SnakeCaseToTitleCase(s string) string {
3335
spacedWords := strings.ReplaceAll(s, "_", " ")
34-
return strings.Title(spacedWords)
36+
return cases.Title(language.English).String(spacedWords)
3537
}
3638

3739
// Constructs a zube `Query` from Cobra flags

0 commit comments

Comments
 (0)