Skip to content
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

Function type which is called once at compile time #75

Open
ghost opened this issue Jun 7, 2020 · 1 comment
Open

Function type which is called once at compile time #75

ghost opened this issue Jun 7, 2020 · 1 comment
Labels

Comments

@ghost
Copy link

ghost commented Jun 7, 2020

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.

@valyala
Copy link
Owner

valyala commented Jun 20, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant