zouyx commented on a change in pull request #1444:
URL: https://github.com/apache/dubbo-go/pull/1444#discussion_r706976631



##########
File path: common/url_test.go
##########
@@ -421,3 +421,11 @@ func TestCompareURLEqualFunc(t *testing.T) {
 func CustomCompareURLEqual(l *URL, r *URL, execludeParam ...string) bool {
        return l.PrimitiveURL == r.PrimitiveURL
 }
+
+func TestURLWithLowerVersion(t *testing.T) {

Review comment:
       I think your test case has not cover all scene.
   You should provide a new test case about `default.version` replace `version`.

##########
File path: protocol/invocation/rpcinvocation.go
##########
@@ -165,6 +165,13 @@ func (r *RPCInvocation) SetAttachments(key string, value 
interface{}) {
        if r.attachments == nil {
                r.attachments = make(map[string]interface{})
        }
+       // compatible "default." prefix
+       if strings.Index(key, constant.DEFAULT_KEY_PREFIX) == 0 {

Review comment:
       Should you use `strings.HasPrefix`?

##########
File path: common/url.go
##########
@@ -259,6 +259,16 @@ func NewURL(urlString string, opts ...Option) (*URL, 
error) {
                return &s, perrors.Errorf("url.ParseQuery(raw url string{%s}),  
error{%v}", serviceUrl.RawQuery, err)
        }
 
+       // compatible "default." prefix
+       for key, value := range s.params {
+               if strings.Index(key, constant.DEFAULT_KEY_PREFIX) == 0 && 
len(value) > 0 {

Review comment:
       Should you use `strings.HasPrefix`?




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