You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/04/04 08:22:55 UTC

[GitHub] [dubbo-go] AlexStocks commented on a diff in pull request #1804: Istio/XDS support

AlexStocks commented on code in PR #1804:
URL: https://github.com/apache/dubbo-go/pull/1804#discussion_r841481758


##########
protocol/invocation/rpcinvocation.go:
##########
@@ -239,6 +244,26 @@ func (r *RPCInvocation) GetAttributeWithDefaultValue(key string, defaultValue in
 	return defaultValue
 }
 
+func (r *RPCInvocation) GetAttachmentAsContext() context.Context {
+	gRPCMD := make(metadata.MD, 0)
+	ctx := context.Background()
+	for k, v := range r.Attachments() {
+		if str, ok := v.(string); ok {
+			gRPCMD.Set(k, str)
+			continue
+		}
+		if str, ok := v.([]string); ok {
+			gRPCMD.Set(k, str...)
+			continue
+		}

Review Comment:
   这里如果是其他类型,是不是得几个错误 log?



-- 
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: dev-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org