Skip to content

Go Template seems to be a bit limited. Is there any way we might have e.g. jinja2? #177

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

Closed
ghost opened this issue Mar 28, 2016 · 1 comment · Fixed by #418
Closed

Go Template seems to be a bit limited. Is there any way we might have e.g. jinja2? #177

ghost opened this issue Mar 28, 2016 · 1 comment · Fixed by #418

Comments

@ghost
Copy link

ghost commented Mar 28, 2016

Go Template'ing seems to be limited and makes some rather basic logical flows impossible or very hard to pull off, see here why: golang/go#14992

While in other templating languages the same logical flow isn't trivially doable either, they usually provide possible workarounds that allow a logical flow as in the link above (for example in jinja2: http://stackoverflow.com/questions/4870346/can-a-jinja-variables-scope-extend-beyond-in-an-inner-block ).

Have you therefore considered providing a more powerful templating language like the popular jinja2 as an alternative? I am aware this would introduce an additional python dependency, but right now I can't do many things in the template I would like to do because of the limitations of Go Template...

@ghost
Copy link
Author

ghost commented Mar 29, 2016

As has been pointed out, the specific use case I gave is doable thanks to various additions of docker-gen for the available functions.

Still, I wonder if some templating engine that is both more popular and has a richer set of known default functions for people might at least be worth a consideration? If it's feasible at all to add it as an alternative of course..

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 a pull request may close this issue.

0 participants