zhaoyunxing92 commented on a change in pull request #1479:
URL: https://github.com/apache/dubbo-go/pull/1479#discussion_r714433924



##########
File path: remoting/nacos/builder.go
##########
@@ -38,94 +36,92 @@ import (
        "github.com/apache/dubbo-go/config"
 )
 
-// NewNacosConfigClient read the config from url and build an instance
-func NewNacosConfigClient(url *common.URL) (config_client.IConfigClient, 
error) {
-       nacosConfig, err := getNacosConfig(url)
+// NewNacosConfigClientByUrl reads the config from url and builds an instance
+func NewNacosConfigClientByUrl(url *common.URL) 
(*nacosClient.NacosConfigClient, error) {
+       sc, cc, err := GetNacosConfig(url)
        if err != nil {
                return nil, err
        }
-       return clients.CreateConfigClient(nacosConfig)
+       return nacosClient.NewNacosConfigClient(getNacosClientName(), true, sc, 
cc)
 }
 
-// getNacosConfig will return the nacos config
-func getNacosConfig(url *common.URL) (map[string]interface{}, error) {
+// GetNacosConfig will return the nacos config
+func GetNacosConfig(url *common.URL) ([]nacosConstant.ServerConfig, 
nacosConstant.ClientConfig, error) {
        if url == nil {
-               return nil, perrors.New("url is empty!")
+               return []nacosConstant.ServerConfig{}, 
nacosConstant.ClientConfig{}, perrors.New("url is empty!")

Review comment:
       返回值如果是指针类型可以直接nil,结构体就不行了




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