sdk-go
sdk-go copied to clipboard
How to return `[]*proto.Message` from an activity?
I'm thinking that I've missed something important in dealing with Protobuffers, rather than how Temporal works. I just want to hear if anybody here knows of this issue.
Expected Behavior
events := make([]*pb.SparkpostEvent, 0)
workflow.ExecuteActivity(context, (*activities.Activities).Unmarshal, data).Get(context, &events)
events should now be a slice of *pb.SparkpostEvent, with all levels of protobuf messages below it Like so:
[
SparkpostEvent {
Msys {
track_event { ... }
}
},
SparkpostEvent{...},
...
]
Actual Behavior
The events slice contains all the root level protobuffers but the children are missing.
I have an array of SparkpostEvents, but Msys is just nil.
Steps to Reproduce the Problem
- Create a protobuffer message a couple of levels deep
- Return an array of them from
.Get()
Specifications
- Version:
- go.temporal.io/api v1.4.1-0.20210429213054-a9a257b5cf16
- go.temporal.io/sdk v1.6.0
- Platform: M1 Mac