From 7d810fc71c554e662929952abef1a6561ccdbc63 Mon Sep 17 00:00:00 2001 From: Pavel Merzlyakov Date: Mon, 18 Dec 2023 15:05:03 +0300 Subject: [PATCH] fix writing fields --- tpl/macros_struct.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {