fix #418: use struct.asMap() for data field (#638)

Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Romanenko Aleksei 2022-04-16 22:17:14 -05:00 committed by GitHub
parent 87af9bf529
commit 5cced6f9fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package rpc
import ( import (
"context" "context"
"fmt"
"net" "net"
"strings" "strings"
"sync" "sync"
@ -97,8 +98,8 @@ func (s *Server) Send(ctx context.Context, in *proto.NotificationRequest) (*prot
if in.Data != nil { if in.Data != nil {
notification.Data = map[string]interface{}{} notification.Data = map[string]interface{}{}
for k, v := range in.Data.Fields { for k, v := range in.Data.AsMap() {
notification.Data[k] = v notification.Data[k] = fmt.Sprintf("%v", v)
} }
} }