AlexStocks commented on a change in pull request #158:
URL: https://github.com/apache/dubbo-go-pixiu/pull/158#discussion_r619730132



##########
File path: pkg/config/config_load.go
##########
@@ -168,22 +185,22 @@ func YAMLConfigLoad(path string) *model.Bootstrap {
                }
                c.Lb = model.LbPolicy(lbPolicy)
        }
-
-       return cfg
 }
 
-// DefaultConfigLoad if not config, will load this
-func DefaultConfigLoad(path string) *model.Bootstrap {
-       log.Println("load config from : ", path)
-       content, err := ioutil.ReadFile(path)
-       if err != nil {
-               log.Fatalln("[config] [default load] load config failed, ", err)
-       }
-       cfg := &model.Bootstrap{}
-       // translate to lower case
-       err = json.Unmarshal(content, cfg)
-       if err != nil {
-               log.Fatalln("[config] [default load] json unmarshal config 
failed, ", err)
+func DiscoverType(cfg *model.Bootstrap) {
+       for _, c := range cfg.StaticResources.Clusters {
+               var discoverType int32

Review comment:
       u can move this var out of the for-loop scope




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

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to