Skip to content

Commit ebd568c

Browse files
committed
go types separate implementation, go-gen refactor, minimal core-templates change
1 parent d807490 commit ebd568c

3 files changed

Lines changed: 638 additions & 209 deletions

File tree

json_explorer/codegen/core/templates.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,15 @@ def _comment_filter(self, value: str, style: str = "//") -> str:
162162

163163
# Built-in templates for common patterns
164164
GO_STRUCT_TEMPLATE = """
165+
{%- if description %}
166+
// {{ description }}
167+
{%- endif %}
165168
type {{ struct_name }} struct {
166169
{%- for field in fields %}
167-
{{ field.name }} {{ field.type }}{% if field.json_tag %} {{ field.json_tag }}{% endif %}
170+
{%- if field.comment %}
171+
// {{ field.comment }}
172+
{%- endif %}
173+
{{ field.name }} {{ field.type }} {% if field.json_tag %} {{ field.json_tag }} {% endif %}
168174
{%- endfor %}
169175
}
170176
"""

0 commit comments

Comments
 (0)