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
func (s*Sub) Process(ctx context.Context, event*proto.Event) error {
md, _:=metadata.FromContext(ctx)
log.Logf("[pubsub.1] Received event %+v with metadata %+v\n", event, md)
// do something with eventreturnnil
}
// Alternatively a function can be usedfuncsubEv(ctx context.Context, event*proto.Event) error {
md, _:=metadata.FromContext(ctx)
log.Logf("[pubsub.2] Received event %+v with metadata %+v\n", event, md)
// do something with eventreturnnil
}
in this demo, the handler function of subscribe topic used a pointer parameter, it will cause an panic error: "file=server/rpc_router.go:512 level=error panic recovered: reflect.Value.Addr of unaddressable value".
I tried use value parameter to fix and it works.
The text was updated successfully, but these errors were encountered:
in this demo, the handler function of subscribe topic used a pointer parameter, it will cause an panic error: "file=server/rpc_router.go:512 level=error panic recovered: reflect.Value.Addr of unaddressable value".
I tried use value parameter to fix and it works.
The text was updated successfully, but these errors were encountered: