Similarityoung commented on code in PR #3029:
URL: https://github.com/apache/dubbo-go/pull/3029#discussion_r2508714343


##########
cluster/router/affinity/router.go:
##########
@@ -85,13 +84,7 @@ type ApplicationAffinityRoute struct {
 
 func newApplicationAffinityRouter(url *common.URL) *ApplicationAffinityRoute {
 
-       application, ok := url.GetAttribute(constant.ApplicationKey)
-       if !ok {
-               logger.Warnf("ApplicationAffinityRoute url does not have 
application attribute, url=%s", url)
-               return nil
-       }
-
-       applicationName := application.(global.ApplicationConfig).Name
+       applicationName := url.GetParam(constant.ApplicationKey, "")

Review Comment:
   有什么好的建议吗,不过这里一般不会用到“”的情况,我打算加个 if == “” 报错的步骤?



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