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

feat: Backfill Sprig functions in Liquid templating #34

Conversation

maciaszczykm
Copy link
Member

@maciaszczykm maciaszczykm commented Jun 4, 2024

Use whole set of Sprig functions and keep old name mappings for backwards compatibility.

Copy link

linear bot commented Jun 4, 2024

Copy link
Member

@michaeljguarino michaeljguarino left a comment

Choose a reason for hiding this comment

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

the ones I reimplemented was for a reason but i don't fully remember. I think it's because pipes in liquid are inverted versus in go template (first vs last arg).

@maciaszczykm
Copy link
Member Author

@michaeljguarino PTAL

}

for name, fnc := range fncs {
if algorithms.Index(excludedFunctions, func(s string) bool { return s == name }) < 0 {
Copy link
Member

Choose a reason for hiding this comment

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

there's a function in github.com/samber/lo for this, I think it's lo.Has

@maciaszczykm maciaszczykm merged commit 040559a into main Jun 7, 2024
5 checks passed
@maciaszczykm maciaszczykm deleted the marcin/eng-2021-backfill-sprig-functions-in-liquid-templating branch June 7, 2024 12:10
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.

2 participants