AlexStocks commented on code in PR #3258:
URL: https://github.com/apache/dubbo-go/pull/3258#discussion_r2940241765
##########
internal/config.go:
##########
@@ -206,3 +206,12 @@ func ValidateMethodConfig(method *global.MethodConfig)
error {
return nil
}
+
+func ValidateRegistryIDs(ids []string, regs map[string]*global.RegistryConfig)
error {
+ for _, id := range ids {
+ if _, ok := regs[id]; !ok {
+ return fmt.Errorf("registry id %q not found", id)
Review Comment:
从 client 和 server 两边各删了一份一模一样的 `validateRegistryIDs`,收到 internal
包里统一维护,消除了重复代码。函数逻辑没变,测试也覆盖到了 valid 和 missing 两种 case,没问题。
另外 client/server 那边删掉函数后,多余的 `fmt` import 也一并清理了,细节到位。
--
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]