diff --git a/tpl/macros_struct.twig b/tpl/macros_struct.twig index 828ca78..d68a15a 100644 --- a/tpl/macros_struct.twig +++ b/tpl/macros_struct.twig @@ -798,7 +798,7 @@ func (s *{{ name|default(o.name) }}) FieldsCount() int { return err } {% else %} - if err := writer.BeginContainer({{ get_all_fields(type)|length }}, "{{ alias }}"); err != nil { + if err := writer.BeginContainer({{ fname }}.FieldsCount(), "{{ alias }}"); err != nil { return err } if err := {{ fname }}.WriteFields(writer); err != nil {