1kasa commented on code in PR #2828:
URL: https://github.com/apache/dubbo-go/pull/2828#discussion_r2030961691


##########
protocol/triple/server.go:
##########
@@ -247,8 +247,24 @@ func (s *Server) handleServiceWithInfo(interfaceName 
string, invoker protocol.In
                                        attachments := 
generateAttachments(req.Header())
                                        // inject attachments
                                        ctx = context.WithValue(ctx, 
constant.AttachmentKey, attachments)
+                                       oldAttachments := 
map[string]interface{}{}
+                                       if original, ok := 
ctx.Value(constant.AttachmentKey).(map[string]interface{}); ok {
+                                               for k, v := range original {
+                                                       oldAttachments[k] = v
+                                               }
+                                       }
                                        invo := 
invocation.NewRPCInvocation(m.Name, args, attachments)
                                        res := invoker.Invoke(ctx, invo)
+                                       newAttachments, _ := 
ctx.Value(constant.AttachmentKey).(map[string]interface{})

Review Comment:
   You're right. Also, I changed the writing style to increase its robustness 
and readability



##########
protocol/triple/server.go:
##########
@@ -247,8 +247,24 @@ func (s *Server) handleServiceWithInfo(interfaceName 
string, invoker protocol.In
                                        attachments := 
generateAttachments(req.Header())
                                        // inject attachments
                                        ctx = context.WithValue(ctx, 
constant.AttachmentKey, attachments)
+                                       oldAttachments := 
map[string]interface{}{}

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to