go-sprout / sprout

From sprig to sprout - Useful template functions for Go templates with steroids
https://sprout.atom.codes
MIT License
86 stars 4 forks source link

feat: notify the end-users to a deprecation on a template function #57

Closed 42atomys closed 3 weeks ago

42atomys commented 3 weeks ago

You have a proposal, explain it!

When you are a middle-app (between sprout and the user how write the template), you need to be careful when you upgrade a template library due to potential breaking changes or deprecated functions.

Describe the solution you'd like

The solution are to embed a notice system in the template library to warn the end-user of a deprecation and let x versions between the deprecation notice and the replacement / removal of the function.

That let the middle-app free to update gradually without fear of being the "single point of failure".

Additional context

Example of using a custom logger (slog.Handler) to bring the deprecation notice in my app logger. image

Code of Conduct