3 ms·
The main thing I hate about Go's template package is that it makes it difficult to define base templates without adding the base file to your ParseFiles argumen
by landr0id 12y ago
The main thing I hate about Go's template package is that it makes it difficult to define base templates without adding the base file to your ParseFiles arguments. I want to be able to say that a template extends another from within that template, not the code.
- unoti 12y agoGo doesn't offer a clear simple way to do this[1] in their builtin template library. But it turns out, it really is possible to do it, as described in this thread on Stack Exchange[2]. I bookmarked that so that I can boil it down into some simple-to-reuse code if I ever bite the bullet and start using Go for the presentation layer on a major website. What they're doing there is a cool technique, but it's not simple to use out of the box. 1. https://sites.google.com/site/usfcomputerscience/django-templates https://sites.google.com/site/usfcomputerscience/django-temp... 2. http://stackoverflow.com/questions/11467731/is-it-possible-to-have-nested-templates-in-go-using-the-standard-library-googl http://stackoverflow.com/questions/11467731/is-it-possible-t...