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

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


The following commit(s) were added to refs/heads/main by this push:
     new 6de48b3cf refactor(root_config): remove redundant nil check in `Init` 
(#2412)
6de48b3cf is described below

commit 6de48b3cf317982228e9d63e92a2a4028907d7dc
Author: Eng Zer Jun <[email protected]>
AuthorDate: Mon Sep 4 17:06:06 2023 +0800

    refactor(root_config): remove redundant nil check in `Init` (#2412)
---
 config/root_config.go | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/config/root_config.go b/config/root_config.go
index e578464fe..07e4b8f5d 100644
--- a/config/root_config.go
+++ b/config/root_config.go
@@ -167,12 +167,9 @@ func (rc *RootConfig) Init() error {
        }
 
        // init registry
-       registries := rc.Registries
-       if registries != nil {
-               for _, reg := range registries {
-                       if err := reg.Init(); err != nil {
-                               return err
-                       }
+       for _, reg := range rc.Registries {
+               if err := reg.Init(); err != nil {
+                       return err
                }
        }
 

Reply via email to