valyala / quicktemplate

Fast, powerful, yet easy to use template engine for Go. Optimized for speed, zero memory allocations in hot paths. Up to 20x faster than html/template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Function type which is called once at compile time

0xqd opened this issue · comments

commented

Is there anyway we can create a type that function which will be called once at compile time instead of being called every time at runtime?
Thanks for creating such amazing package.

You may use two-step go:generate for generating template output from *.qtpl files before compile time:

  • Generate *.qtpl.go files at first step with qtc.
  • Generate output file from the generated *.qtpl.go files with go run.