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

About the variable .imports in templates #4218

Open
13100967125 opened this issue Jun 28, 2024 · 2 comments
Open

About the variable .imports in templates #4218

13100967125 opened this issue Jun 28, 2024 · 2 comments

Comments

@13100967125
Copy link

修改logic.tpl模版,将原来的Context注入改为*http.Request注入,但是生成之后的文件还是导入Context包而不是net/http包,需要使用goland手动导入一下,请问这个地方需要怎么修改

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Modify the logic.tpl template and change the original Context injection to *http.Request injection. However, the generated file still imports the Context package instead of the net/http package. You need to use goland to import it manually. How do you need to modify this place@@ ====About template built-in variables.imports

@kesonan
Copy link
Collaborator

kesonan commented Jun 29, 2024

The context package is fixed by the goctl code, and the template cannot be controlled.

@kevwan kevwan changed the title 关于模版内置变量.imports About the variable .imports in templates Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants