You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/09/22 13:39:45 UTC

[GitHub] [dubbo-go] cjphaha commented on a change in pull request #1479: Nacos client enhance

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



##########
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:
       why not return nil directly




-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org