quicktemplate icon indicating copy to clipboard operation
quicktemplate copied to clipboard

Function type which is called once at compile time

Open ghost opened this issue 5 years ago • 1 comments

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.

ghost avatar Jun 07 '20 01:06 ghost

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.

valyala avatar Jun 20 '20 15:06 valyala