Import order conflicts between templ-generated _templ.go files and goimports. How do you go about it? #1254
Unanswered
preslavrachev
asked this question in
Q&A
Replies: 2 comments 1 reply
-
|
templ uses goimports to process the files: https://github.com/a-h/templ/blob/main/internal/imports/process.go I wonder if it's a difference in version, or something else... If you can make a minimal repro, I'll take a look, since I'm not seeing the same issue myself. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Just installed the latest version of
I will also check the templ version now. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
For one of our projects, I’ve been running into a recurring problem with
templandgoimports:templgenerates_templ.gofiles with a specific import order.goimports(run as a post-save hook) immediately rewrites those imports into a different order.It seems like
goimportshas bluntly ignores the fact that_templ.gofiles are generated and are not really meant to be read or modified. One of our requirements from the start has been committing both.templand_templ.gofiles in the repo, in order to not burden our consumers with runningtemplupon installing. Plus, we also have a few smoke tests set on the_templ.gofiles directly.So, I was wondering, is the different import order something worth a proper temple issue? I mean, we can go about it by supplying files t
goimportsusingfindandxargs, but it's just a pain to do it in every project.How do you guys go about it?
Beta Was this translation helpful? Give feedback.
All reactions