justxuewei commented on code in PR #2152: URL: https://github.com/apache/dubbo-go/pull/2152#discussion_r1058015593
########## common/url.go: ########## @@ -711,8 +711,17 @@ func MergeURL(serviceURL *URL, referenceURL *URL) *URL { // finally execute methodConfigMergeFcn for _, method := range referenceURL.Methods { - for _, fcn := range methodConfigMergeFcn { - fcn("methods." + method) + for _, paramKey := range []string{constant.LoadbalanceKey, constant.ClusterKey, constant.RetriesKey, constant.TimeoutKey} { + if v := referenceURL.GetParam(paramKey, ""); len(v) > 0 { + params[paramKey] = []string{v} + } + + methodsKey := "methods." + method + "." + paramKey + if len(mergedURL.GetParam(methodsKey, "")) == 0 { + if v := referenceURL.GetParam(method+"."+paramKey, ""); len(v) > 0 { Review Comment: Here should use `methodsKey`. ########## common/url.go: ########## @@ -711,8 +711,17 @@ func MergeURL(serviceURL *URL, referenceURL *URL) *URL { // finally execute methodConfigMergeFcn for _, method := range referenceURL.Methods { - for _, fcn := range methodConfigMergeFcn { - fcn("methods." + method) + for _, paramKey := range []string{constant.LoadbalanceKey, constant.ClusterKey, constant.RetriesKey, constant.TimeoutKey} { + if v := referenceURL.GetParam(paramKey, ""); len(v) > 0 { + params[paramKey] = []string{v} + } + + methodsKey := "methods." + method + "." + paramKey + if len(mergedURL.GetParam(methodsKey, "")) == 0 { + if v := referenceURL.GetParam(method+"."+paramKey, ""); len(v) > 0 { + params[method+"."+paramKey] = []string{v} Review Comment: Here should use `methodsKey`. -- 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-unsubscr...@dubbo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org