AlexStocks commented on a change in pull request #537:
URL: https://github.com/apache/dubbo-go/pull/537#discussion_r431233114



##########
File path: protocol/invocation/rpcinvocation.go
##########
@@ -111,6 +113,25 @@ func (r *RPCInvocation) AttachmentsByKey(key string, 
defaultValue string) string
        return defaultValue
 }
 
+// get attributes
+func (r *RPCInvocation) Attributes() map[string]interface{} {
+       return r.attributes
+}
+
+// get attribute by key. If it is not exist, it will return default value
+func (r *RPCInvocation) AttributeByKey(key string, defaultValue interface{}) 
interface{} {
+       r.lock.RLock()
+       defer r.lock.RUnlock()
+       if r.attributes == nil {

Review comment:
       @flycash can not agree with u more.




----------------------------------------------------------------
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.

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org
For additional commands, e-mail: notifications-h...@dubbo.apache.org

Reply via email to