From: Reinhard Tartler Date: Wed, 12 Aug 2026 07:57:31 +0200 Subject: Use xstrings.ToPascalCase for camelcase function camelcase used to call xstrings.ToCamelCase, but that function had a breaking change in xstrings version 1.5 that moved it from upper camel case to lower camel case. This breaks sprig's public API. A new xstrings.ToPascalCase function was added that provides upper camel case. Backport of upstream commit fe8e5b9 (sprig v3.3.0). Closes: #1143319 Forwarded: https://github.com/Masterminds/sprig/commit/fe8e5b963cddb929b1ba4a9684401a84f382845a --- functions.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/functions.go b/functions.go index 57fcec1..5dd9c28 100644 --- a/functions.go +++ b/functions.go @@ -142,10 +142,13 @@ var genericMap = map[string]interface{}{ "swapcase": util.SwapCase, "shuffle": xstrings.Shuffle, "snakecase": xstrings.ToSnakeCase, - "camelcase": xstrings.ToCamelCase, - "kebabcase": xstrings.ToKebabCase, - "wrap": func(l int, s string) string { return util.Wrap(s, l) }, - "wrapWith": func(l int, sep, str string) string { return util.WrapCustom(str, l, sep, true) }, + // camelcase used to call xstrings.ToCamelCase, but that function had a breaking change in version + // 1.5 that moved it from upper camel case to lower camel case. This is a breaking change for sprig. + // A new xstrings.ToPascalCase function was added that provided upper camel case. + "camelcase": xstrings.ToPascalCase, + "kebabcase": xstrings.ToKebabCase, + "wrap": func(l int, s string) string { return util.Wrap(s, l) }, + "wrapWith": func(l int, sep, str string) string { return util.WrapCustom(str, l, sep, true) }, // Switch order so that "foobar" | contains "foo" "contains": func(substr string, str string) bool { return strings.Contains(str, substr) }, "hasPrefix": func(substr string, str string) bool { return strings.HasPrefix(str, substr) },