Aetherance commented on code in PR #3252:
URL: https://github.com/apache/dubbo-go/pull/3252#discussion_r2958124584


##########
client/options.go:
##########
@@ -546,6 +555,17 @@ func setRegistries(regs map[string]*global.RegistryConfig) 
ReferenceOption {
        }
 }
 
+func setRouters(routers []*global.RouterConfig) ReferenceOption {
+       return func(opts *ReferenceOptions) {
+               if len(routers) > 0 {
+                       if opts.Routers == nil {
+                               opts.Routers = make([]*global.RouterConfig, 0)
+                       }
+                       opts.Routers = append(opts.Routers, routers...)
+               }
+       }
+}

Review Comment:
   这里的 setRouters 和 SetClientRouters 都是框架内部函数,我已经将它们统一为 replace 语义
   WithClientRouter 作为用户侧配置入口,保留为 append 语义。
   同时我补充了注释,明确了三者各自的 append / replace 语义,并说明 SetClientRouters 仅供框架内部使
   用。



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

Reply via email to