File tree Expand file tree Collapse file tree 3 files changed +18
-99
lines changed
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/golang Expand file tree Collapse file tree 3 files changed +18
-99
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ src/baseline/SbeMarshalling.go: $(DEP)
5959# they geenrate into the same directory but golang doesn't allow that
6060test : $(DEP )
6161(export GOPATH=$( GOPATH) && \
62- (for t in baseline extension extension2 ; do \
62+ (for t in baseline extension; do \
6363export GOPATH=$(GOPATH ) && \
6464 cd $(GOPATH ) /src/$$ t && \
6565go build && \
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -494,10 +494,23 @@ private void generateOptionalInitPrimitive(
494494 final Encoding encoding = token .encoding ();
495495
496496 // Optional items get initialized to their NullValue
497- sb .append (String .format (
498- "\t %1$s = %2$s\n " ,
499- varName ,
500- generateNullValueLiteral (encoding .primitiveType (), encoding )));
497+ if (token .arrayLength () > 1 )
498+ {
499+ sb .append (String .format (
500+ "\t for idx := 0; idx < %1$d; idx++ {\n " +
501+ "\t \t %2$s[idx] = %3$s\n " +
502+ "\t }\n " ,
503+ token .arrayLength (),
504+ varName ,
505+ generateNullValueLiteral (encoding .primitiveType (), encoding )));
506+ }
507+ else
508+ {
509+ sb .append (String .format (
510+ "\t %1$s = %2$s\n " ,
511+ varName ,
512+ generateNullValueLiteral (encoding .primitiveType (), encoding )));
513+ }
501514 }
502515
503516 private void generateConstantInitPrimitive (
You can’t perform that action at this time.
0 commit comments