This is an automated email from the ASF dual-hosted git repository.

alexstocks pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new cee963f  registry 默认值问题 (#1275)
cee963f is described below

commit cee963fd392eeb8f2daa445f9bfda1b8ee6e67dd
Author: wangxw666 <[email protected]>
AuthorDate: Fri Jun 25 17:28:43 2021 +0800

    registry 默认值问题 (#1275)
    
    Co-authored-by: wangxiaowei14227 <[email protected]>
---
 config/config_loader.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/config/config_loader.go b/config/config_loader.go
index 9fc7da4..07ef325 100644
--- a/config/config_loader.go
+++ b/config/config_loader.go
@@ -103,7 +103,7 @@ func setDefaultValue(target interface{}) {
        switch target.(type) {
        case *ProviderConfig:
                p := target.(*ProviderConfig)
-               if len(p.Registries) == 0 {
+               if len(p.Registries) == 0 && p.Registry == nil {
                        p.Registries[constant.DEFAULT_REGISTRY_ZK_ID] = 
registryConfig
                }
                if len(p.Protocols) == 0 {
@@ -117,7 +117,7 @@ func setDefaultValue(target interface{}) {
                }
        default:
                c := target.(*ConsumerConfig)
-               if len(c.Registries) == 0 {
+               if len(c.Registries) == 0 && c.Registry == nil {
                        c.Registries[constant.DEFAULT_REGISTRY_ZK_ID] = 
registryConfig
                }
                if c.ApplicationConfig == nil {

Reply via email to