4 ms·
I've used Go's templating a few times, most recently I used it in my own static site generator. For me the most difficult thing about it is that it is another
by regus 6y ago
I've used Go's templating a few times, most recently I used it in my own static site generator.
For me the most difficult thing about it is that it is another language grafted on top of Go, and it does not always do what you expect it to do.
The documentation is hard read and not always clear on how things are supposed to work.
For example:
- If I pass in a struct that contains a map of structs, how exactly can I access this data?
- How can I use the boolean output of a function within an if statement?
- How do the if statements even work? "eq"? "=="? What is the correct syntax here?
I ended up losing a lot of time having of to wrestle with the templating engine because it often would not behave the way I expected it to.
- mroche 6y ago> For me the most difficult thing about it is that it is another language grafted on top of Go, and it does not always do what you expect it to do. ... Ah, I see. At my first glance I thought it was just normal Go syntax. I’ll have to look into this more, thanks!