Masterminds / sprig

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

Add YAML funcs: `fromYaml`, `toYaml`, `mustFromYaml`, `mustToYaml` #366

Closed gabe565 closed 1 year ago

gabe565 commented 1 year ago

Hello! I love Sprig and use it in pretty much every project I build that uses Go templates. I was surprised to see that YAML isn't supported. I use Helm often and have grown used to fromYaml and toYaml.

This PR adds new funcs to handle YAML: fromYaml, toYaml, mustFromYaml, and mustToYaml along with new tests.

Closes #358

gabe565 commented 1 year ago

Whoops, I missed #360 before now, so I'll close this!