Alanxtl commented on code in PR #3256:
URL: https://github.com/apache/dubbo-go/pull/3256#discussion_r2938906613
##########
cluster/router/polaris/router.go:
##########
@@ -92,6 +106,24 @@ func newPolarisRouter(url *common.URL) (*polarisRouter,
error) {
}, nil
}
+func getApplicationNameFromAttribute(raw any) string {
+ switch appConf := raw.(type) {
+ case *global.ApplicationConfig:
+ if appConf != nil {
+ return appConf.Name
+ }
+ case global.ApplicationConfig:
+ return appConf.Name
+ case *config.ApplicationConfig:
+ if appConf != nil {
+ return appConf.Name
+ }
+ case config.ApplicationConfig:
+ return appConf.Name
+ }
Review Comment:
config包我们以后要删除,不用考虑config了
##########
cluster/router/polaris/router.go:
##########
@@ -92,6 +106,24 @@ func newPolarisRouter(url *common.URL) (*polarisRouter,
error) {
}, nil
}
+func getApplicationNameFromAttribute(raw any) string {
+ switch appConf := raw.(type) {
+ case *global.ApplicationConfig:
+ if appConf != nil {
+ return appConf.Name
+ }
+ case global.ApplicationConfig:
+ return appConf.Name
+ case *config.ApplicationConfig:
+ if appConf != nil {
+ return appConf.Name
+ }
+ case config.ApplicationConfig:
+ return appConf.Name
+ }
+ return ""
+}
Review Comment:
这个switch也不用包装一个函数
##########
cluster/router/chain/chain.go:
##########
@@ -109,12 +108,6 @@ func (c *RouterChain) copyRouters()
[]router.PriorityRouter {
// NewRouterChain init router chain
// Loop routerFactories and call NewRouter method
func NewRouterChain(url *common.URL) (*RouterChain, error) {
- if url.SubURL != nil {
- if appName := url.SubURL.GetParam(constant.ApplicationKey, "");
appName != "" {
- url.CompareAndSwapParam(constant.ApplicationKey, "",
appName)
- }
- }
Review Comment:
为啥要把这一个函数删掉
--
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]