From 5cced6f9faff19bdd2d02c15cad50554927c3a2d Mon Sep 17 00:00:00 2001 From: Romanenko Aleksei Date: Sat, 16 Apr 2022 22:17:14 -0500 Subject: [PATCH] fix #418: use struct.asMap() for data field (#638) Co-authored-by: Bo-Yi Wu --- rpc/server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rpc/server.go b/rpc/server.go index 421ebab..652d571 100644 --- a/rpc/server.go +++ b/rpc/server.go @@ -2,6 +2,7 @@ package rpc import ( "context" + "fmt" "net" "strings" "sync" @@ -97,8 +98,8 @@ func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*prot if in.Data != nil { notification.Data = map[string]interface{}{} - for k, v := range in.Data.Fields { - notification.Data[k] = v + for k, v := range in.Data.AsMap() { + notification.Data[k] = fmt.Sprintf("%v", v) } }