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/07/21 15:06:28 UTC

[GitHub] [dubbo-go] Mulavar commented on a change in pull request #1324: fix: #1323 delete zk registry when set defualt consumer/provider config

Mulavar commented on a change in pull request #1324:
URL: https://github.com/apache/dubbo-go/pull/1324#discussion_r674060043



##########
File path: config/consumer_config.go
##########
@@ -83,7 +83,7 @@ func SetConsumerConfig(c ConsumerConfig) {
 // ConsumerInit loads config file to init consumer config
 func ConsumerInit(confConFile string) error {
 	if confConFile == "" {
-		return perrors.Errorf("application configure(consumer) file name is nil")

Review comment:
       这部分需要结合config_loader.go来看,初始化provider和consumer config有这么一段逻辑
   if errCon := ConsumerInit(confConFile); errCon != nil {
       consumerConfig = nil
   } else if confBaseFile == "" {
       setDefaultValue(consumerConfig)
   }
   为了保证file==""的时候能走到setdefaultvalue的分支,因此这里改成return nil

##########
File path: config/provider_config.go
##########
@@ -70,7 +70,7 @@ func SetProviderConfig(p ProviderConfig) {
 // ProviderInit loads config file to init provider config
 func ProviderInit(confProFile string) error {
 	if len(confProFile) == 0 {
-		return perrors.Errorf("application configure(provider) file name is nil")

Review comment:
       as above




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