Description
The following program will panic because part of the proto3 message cannot be JSON marshalled.
panic: failed to decode data: json: cannot unmarshal object into Go struct field Path_Node.Specialization of type internal_go_proto.isPath_Node_Specialization
package main import ( "context" "github.com/apache/beam/sdks/go/pkg/beam" "github.com/apache/beam/sdks/go/pkg/beam/x/beamx" "github.com/apache/beam/sdks/go/pkg/beam/x/debug" ipb "kythe.io/kythe/proto/internal_go_proto" srvpb "kythe.io/kythe/proto/serving_go_proto" ) func main() { ctx := context.Background() beam.Init() p := beam.NewPipeline() s := p.Root() e := &ipb.Path_Node{ // proto3 oneof fields cannot be JSON marshalled Specialization: &ipb.Path_Node_RawAnchor{&srvpb.RawAnchor{}}, } els := beam.Create(s, e) debug.Print(s, els) if err := beamx.Run(ctx, p); err != nil { panic(err) } }
Attachments
Issue Links
- links to