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
The generated templates, templateB.html.go and templateA.html.go will both have the MyPartial type declaration, which will cause the MyPartial redeclared in this block golang error.
One potential solution to this issue would be to add a new syntax dedicated to type declarations. The types declared using this new syntax would only be output once.
Let me know if there's an alternative way to accomplish this that I'm missing. I'm also willing to submit a PR if fixing this issue is non-trivial to accomplish. Thank you very much!
The text was updated successfully, but these errors were encountered:
abalbanyan
changed the title
Declaring a type struct in the import block of a partial will duplicate that type when the partial is used in multiple places.
Declaring a type struct in the import block of a partial will duplicate that type when the partial is used in multiple templates.
Jun 10, 2020
abalbanyan
changed the title
Declaring a type struct in the import block of a partial will duplicate that type when the partial is used in multiple templates.
Declaring a type in the import block of an include will duplicate that type declaration when the include is used in multiple templates.
Jun 10, 2020
I'd like to be able to declare types in my partial files.
partial.html
templateA.html
templateB.html
The generated templates, templateB.html.go and templateA.html.go will both have the
MyPartial
type declaration, which will cause theMyPartial redeclared in this block
golang error.One potential solution to this issue would be to add a new syntax dedicated to type declarations. The types declared using this new syntax would only be output once.
Let me know if there's an alternative way to accomplish this that I'm missing. I'm also willing to submit a PR if fixing this issue is non-trivial to accomplish. Thank you very much!
The text was updated successfully, but these errors were encountered: