You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey,
I'm trying to unmarshal some JSON response back into Protobuf.
but I'm getting json: cannot unmarshal string into Go value of type map[string]json.RawMessage
and it's caused by the ID field
from
s := []byte(`{"id":"5eaacacc6149d0f8d4b6a36d"}`)
var rsp pb.IDMsg
unmarshaler = jsonpb.Unmarshaler{AllowUnknownFields: false}
if err := unmarshaler.Unmarshal(bytes.NewBuffer(s), &rsp); err != nil {
t.Fatal(err)
}
Hey,
I'm trying to unmarshal some JSON response back into Protobuf.
but I'm getting
json: cannot unmarshal string into Go value of type map[string]json.RawMessage
and it's caused by the ID field
from
pb.proto:
pb.go:
The text was updated successfully, but these errors were encountered: