You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When generate fails, go is still using old _templ.go files. This makes it easy to miss a problem since build still works and is using out of date generated code. This can be achieved easily by moving targetFileName := strings.TrimSuffix(fileName, ".templ") + "_templ.go" to the begining of generatecmd.compile func and calling os.Remove(targetFileName) before any parsing is done.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When generate fails, go is still using old _templ.go files. This makes it easy to miss a problem since build still works and is using out of date generated code. This can be achieved easily by moving
targetFileName := strings.TrimSuffix(fileName, ".templ") + "_templ.go"
to the begining of generatecmd.compile func and callingos.Remove(targetFileName)
before any parsing is done.Beta Was this translation helpful? Give feedback.
All reactions