Skip to content

Commit

Permalink
fix #418: use struct.asMap() for data field (#638)
Browse files Browse the repository at this point in the history
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
slimus and appleboy committed Apr 17, 2022
1 parent 87af9bf commit 5cced6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package rpc

import (
"context"
"fmt"
"net"
"strings"
"sync"
Expand Down Expand Up @@ -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)
}
}

Expand Down

0 comments on commit 5cced6f

Please sign in to comment.