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: [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]