Masterminds / sprig

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

feat: add yaml to/from functions #360

Open blakepettersson opened 1 year ago

blakepettersson commented 1 year ago

In the same vein of #223, add YAML conversion functions. Fixes #358.

yebolenko commented 1 year ago

any update on this?

alexbde commented 1 year ago

@technosophos @mattfarina would you like to have a look at it? Seems to be a piece of cake 🍰 :)

gabe565 commented 1 year ago

I mistakenly opened a PR that did the same thing. I just closed it, but wanted to chime in to say I could really use these! Thanks for all the work you guys do 🙂

acelinkio commented 1 year ago

Appreciate your work on this @blakepettersson, when you have a chance can you review the comments? Would love to see this integrated in! Awesome job!

blakepettersson commented 10 months ago

@mattfarina in the case of toYaml it's pretty straightforward. My only concern is that this is inconsistent with how it's done with the existing tojson function.

Would it make sense to do the same with toJson?

In the case of fromYaml the same question arises; would it make sense to have an extra function in case a caller wants an Error map returned? Would it then make sense to have the same for the json unmarshling?

acelinkio commented 8 months ago

@mattfarina , any chance you could review blacke's comments above? Would like to see this implemented as this would help a lot of downstream projects! Thanks!

cornfeedhobo commented 5 months ago

1 Year :(

42atomys commented 1 month ago

Hello everyone 👋,

I wanted to let you know that this issue has been addressed in the fork of this project at go-sprout/sprout. The fix has been implemented starting from version v0.4.0.

For those looking for a solution, I recommend checking out the latest releases of the fork. This should help address the issue discussed in this thread.

Thank you!