Qiao-yq commented on code in PR #3401:
URL: https://github.com/apache/dubbo-go/pull/3401#discussion_r3401965167


##########
remoting/getty/getty_client.go:
##########
@@ -63,71 +62,37 @@ func initClient(url *common.URL) {
                return
        }
 
-       // load client config from rootConfig.Protocols
-       // default use dubbo
-       // TODO: Temporary compatibility with old APIs, can be removed later
-       if url.GetParam(constant.ApplicationKey, "") == "" && 
config.GetApplicationConfig() == nil {
-               return
+       // Ensure application config is available via URL attribute
+       commonCfg.EnsureApplicationAttribute(url)
+
+       if url.GetParam(constant.ProtocolKey, "") == "" {
+               if _, ok := url.GetAttribute(constant.ProtocolConfigKey); !ok {
+                       return

Review Comment:
   噢噢,我的错
   在我修改前,这个用的是GetParam和legacy config来做guard,我只是把legacy config换成了GetAttribute
   后面在下面讨论后发现,GetParam其实取不到东西,然后我把这个删掉了,只保留了GetAttribute
   假设原代码存了协议名到param,那就不会出现第一个空第二个不空的情况了,GetParam直接取到了
   



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