docs: private int generateGroupEncodeDecode(
          final List<Token> tokens,
          final String typeName,
          final StringBuilder encode,
          final StringBuilder decode,
          final StringBuilder rc,
          final int currentOffset)
      {
          final char varName = Character.toLowerCase(typeName.charAt(0));
          final Token signalToken = tokens.get(0);
          final String propertyName = formatPropertyName(signalToken.name());
          final Token blockLengthToken = Generators.findFirst("blockLength", tokens, 0);
          final Token numInGroupToken = Generators.findFirst("numInGroup", tokens, 0);
          final int blockLengthOffset = blockLengthToken.offset();
          final String blockLengthType = golangTypeName(blockLengthToken.encoding().primitiveType());
          final String blockLengthMarshalType = golangMarshalType(blockLengthToken.encoding().primitiveType());
          final int numInGroupOffset = numInGroupToken.offset();
          final String numInGroupType = golangTypeName(numInGroupToken.encoding().primitiveType());
          final String numInGroupMarshalType = golangMarshalType(numInGroupToken.encoding().primitiveType());
  
          // Offset handling
          final int gap = Math.max(signalToken.offset() - currentOffset, 0);
          encode.append(generateEncodeOffset(gap, ""));
          decode.append(generateDecodeOffset(gap, ""));
  
          final String encBlockLengthTmpl =
              "\tvar %7$sBlockLength %1$s = %2$d\n" +
              "\tif err := _m.Write%6$s(_w, %7$sBlockLength); err != nil {\n" +
              "\t\treturn err\n" +
              "\t}\n";
  
          final String encNumInGroupTmpl =
              "\tvar %7$sNumInGroup %3$s = %3$s(len(%4$s.%5$s))\n" +
              "\tif err := _m.Write%8$s(_w, %7$sNumInGroup); err != nil {\n" +
              "\t\treturn err\n" +
              "\t}\n";
  
          // Order write based on offset
          final String encGrpMetaTmpl = blockLengthOffset < numInGroupOffset ?
              encBlockLengthTmpl + encNumInGroupTmpl : encNumInGroupTmpl + encBlockLengthTmpl;
  
          encode.append(String.format(encGrpMetaTmpl,
              blockLengthType,
              signalToken.encodedLength(),
              numInGroupType,
              varName,
              toUpperFirstChar(signalToken.name()),
              blockLengthMarshalType,
              propertyName,
              numInGroupMarshalType));
  
          // Write the group itself
          encode.append(String.format(
              "\tfor _, prop := range %1$s.%2$s {\n" +
              "\t\tif err := prop.Encode(_m, _w); err != nil {\n" +
              "\t\t\treturn err\n" +
              "\t\t}\n",
              varName,
              toUpperFirstChar(signalToken.name())));
  
          decode.append(String.format(
              "\n" +
              "\tif %1$s.%2$sInActingVersion(actingVersion) {\n",
              varName,
              propertyName));
  
          final String decBlockLengthTmpl =
              "\t\tvar %1$sBlockLength %2$s\n" +
              "\t\tif err := _m.Read%4$s(_r, &%1$sBlockLength); err != nil {\n" +
              "\t\t\treturn err\n" +
              "\t\t}\n";
  
          final String decNumInGroupTmpl =
              "\t\tvar %1$sNumInGroup %3$s\n" +
              "\t\tif err := _m.Read%5$s(_r, &%1$sNumInGroup); err != nil {\n" +
              "\t\t\treturn err\n" +
              "\t\t}\n";
  
          final String decGrpMetaTmpl = blockLengthOffset < numInGroupOffset ?
              decBlockLengthTmpl + decNumInGroupTmpl : decNumInGroupTmpl + decBlockLengthTmpl;
  
          decode.append(String.format(decGrpMetaTmpl,
              propertyName,
              blockLengthType,
              numInGroupType,
              blockLengthMarshalType,
              numInGroupMarshalType));
  
          // Read the group itself
          decode.append(String.format(
              "\t\tif cap(%1$c.%2$s) < int(%2$sNumInGroup) {\n" +
              "\t\t\t%1$s.%2$s = make([]%3$s%2$s, %2$sNumInGroup)\n" +
              "\t\t}\n" +
              "\t\tfor i, _ := range %1$s.%2$s {\n" +
              "\t\t\tif err := %1$s.%2$s[i].Decode(_m, _r, actingVersion, uint(%4$sBlockLength)); err != nil {\n" +
              "\t\t\t\treturn err\n" +
              "\t\t\t}\n" +
              "\t\t}\n",
              varName,
              toUpperFirstChar(signalToken.name()),
              typeName,
              propertyName));
  
          // Range check the group itself
          rc.append(String.format(
              "\tfor _, prop := range %1$s.%2$s {\n" +
              "\t\tif err := prop.RangeCheck(actingVersion, schemaVersion); err != nil {\n" +
              "\t\t\treturn err\n" +
              "\t\t}\n" +
              "\t}\n",
              varName,
              toUpperFirstChar(signalToken.name())));
  
          return gap;
      }