xxs588 commented on code in PR #3256:
URL: https://github.com/apache/dubbo-go/pull/3256#discussion_r2939349837
##########
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:
<img width="1044" height="1134" alt="图片"
src="https://github.com/user-attachments/assets/2910ad72-fc7f-460b-8ac1-63c80a833455"
/>
已修复,删除了包装的switch,改为内联在 newPolarisRouter函数里做判断
--
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]