You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2022/02/23 17:31:13 UTC
[plc4x] branch feature/cleaned-up-type-references updated: fix(codegen): fixed small issue in go tempate
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch feature/cleaned-up-type-references
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/feature/cleaned-up-type-references by this push:
new 9afb345 fix(codegen): fixed small issue in go tempate
9afb345 is described below
commit 9afb345a1ef7e69c395b7562ebd10b474bb6612d
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Wed Feb 23 18:31:04 2022 +0100
fix(codegen): fixed small issue in go tempate
---
.../language-go/src/main/resources/templates/go/model-template.go.ftlh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code-generation/language-go/src/main/resources/templates/go/model-template.go.ftlh b/code-generation/language-go/src/main/resources/templates/go/model-template.go.ftlh
index 730adcc..89031ec 100644
--- a/code-generation/language-go/src/main/resources/templates/go/model-template.go.ftlh
+++ b/code-generation/language-go/src/main/resources/templates/go/model-template.go.ftlh
@@ -1572,7 +1572,7 @@ func (m *${type.name}) Serialize(writeBuffer utils.WriteBuffer) error {
}
<#assign enumValueFieldAccessor="m."+enumField.name?cap_first+"."+enumField.fieldName?cap_first+"()">
// Enum field (${enumField.name})
- _${enumField.name}Err := ${helper.getWriteBufferWriteMethodCall(enumField.type.asComplexTypeReference().orElseThrow().name, helper.getEnumFieldSimpleTypeReference(enumField.type, enumField.fieldName), enumValueFieldAccessor, enumField, "utils.WithAdditionalStringRepresentation(m.${enumField.name?cap_first}.name())")}
+ _${enumField.name}Err := ${helper.getWriteBufferWriteMethodCall(enumField.type.asNonSimpleTypeReference().orElseThrow().name, helper.getEnumFieldSimpleTypeReference(enumField.type, enumField.fieldName), enumValueFieldAccessor, enumField, "utils.WithAdditionalStringRepresentation(m.${enumField.name?cap_first}.name())")}
if _${enumField.name}Err != nil {
return errors.Wrap(_${enumField.name}Err, "Error serializing '${enumField.name}' field")<@emitImport import="github.com/pkg/errors" />
}