Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Sprig functions to go templates #1127

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

wunter8
Copy link
Contributor

@wunter8 wunter8 commented Jun 3, 2024

fixes #1121

Sprig is the library used on https://repeatit.io

Copy link

@Devwanabe Devwanabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing connection to the server through my gateway connection. Am I using incorrect source code? What am I doing wrong

@binwiederhier
Copy link
Owner

Hm. This adds 9 dependencies to ntfy for such a tiny little mini feature. 9 dependencies are 9 chances to be injected with some random code from strangers and 9 chances for things to break in the future.

Maybe we can copy a subset of it, or just write some really useful ones ourselves? It's certainly cool to have these functions in there but damn 9 dependencies is brutal.

@wunter8
Copy link
Contributor Author

wunter8 commented Jun 14, 2024

Yeah, we can probably implement our own. It looks like there are about 70 functions total. Some of them we probably don't need (like the path functions), and some of them we probably don't even want (like the os env function)

Let me know which ones you think we should include/implement by hand

@UiP9AV6Y
Copy link

there is also slim-sprig which was apparently created for this exact reason. it does not have any external dependencies

@wunter8
Copy link
Contributor Author

wunter8 commented Nov 11, 2024

Thanks for the suggestion! That seems like a good way to get additional functionality without all the dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add utility functions to Message Templates
4 participants