github.com/Masterminds/sprig is a popular library of template functions, used by some popular projects, e.g. Kubernetes Helm.
Unfortunately, Masterminds/sprig also has a number of inherent flaws:
1. The order of arguments to many of its functions is incompatible with text/template's pipeline syntax.
2. Many of its functions do not handle strings, []bytes, variable numbers of arguments, and other argument variations in a sensible way.
3. It has, at the time of writing,
78 open issues, most of them unaddressed, and has seen only minor maintenance activity over the last few years.
4. Its function names do not follow Go's naming conventions.
#1 and #2 cannot be fixed in a backwards-compatible way. #3 means that fixes aren't practically accepted anyway. #4 just means that templates using Masterminds/sprig are ugly to Go developer eyes.
Instead, I want a library of template functions that works well with text/template, has decent ergonomics, follows Go's naming conventions, and is actively maintained. I don't care about backwards compatibility with sprig as this is impossible to achieve anyway.
Before I start such a project, are there any existing good existing alternatives to Masterminds/sprig?
Many thanks,
Tom