diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2022-03-28 18:48:43 -0400 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2022-03-28 22:43:11 -0400 |
| commit | 8767e64ff07c0ef9a40157380cd5ed58b1a6cf60 (patch) | |
| tree | 11b0d7663f1bb951feb0549c311960d391c8a6b5 /strings | |
| parent | 09ea51abb4b5fe2626847f168cb0a49c4cf94f32 (diff) | |
Log warning message when a deprecated function or datasource is used
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'strings')
| -rw-r--r-- | strings/strings.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/strings/strings.go b/strings/strings.go index d822a57d..269e760f 100644 --- a/strings/strings.go +++ b/strings/strings.go @@ -7,6 +7,9 @@ import ( "strings" "github.com/Masterminds/goutils" + "github.com/hairyhenderson/gomplate/v3/conv" + "golang.org/x/text/cases" + "golang.org/x/text/language" ) // Indent - indent each line of the string with the given indent string. @@ -89,7 +92,8 @@ func casePrepare(in string) string { // CamelCase - func CamelCase(in string) string { in = strings.TrimSpace(in) - s := strings.Title(in) + tag := language.Und + s := cases.Title(tag).String(conv.ToString(in)) // make sure the first letter remains lower- or upper-cased s = strings.Replace(s, string(s[0]), string(in[0]), 1) return nonAlphaNum.ReplaceAllString(s, "") |
