Masterminds / sprig

Useful template functions for Go templates.
http://masterminds.github.io/sprig/
MIT License
4.25k stars 436 forks source link

support pipe for `omit` and `pick` #367

Open universam1 opened 1 year ago

universam1 commented 1 year ago

It was surprising to me to learn that omit and pick do not support a pipe signature, as it reads natural to me.

{{- range $key, $value := include "myConf" . | fromYaml | omit "somekey" -}}
{{- dict "one" 1 "two" 222222 | pick "two" -}}

Instead it errors out

can't handle "xy" for arg of type map[string]interface {}