You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by wo...@apache.org on 2019/10/28 05:28:48 UTC

[dubbo-go-hessian2] branch master updated: Fix: check service.Group and service.Interface

This is an automated email from the ASF dual-hosted git repository.

wongoo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-go-hessian2.git


The following commit(s) were added to refs/heads/master by this push:
     new 0ef53e4  Fix: check service.Group and service.Interface
     new 12eb647  Merge pull request #138 from fangyincheng/master
0ef53e4 is described below

commit 0ef53e44a8fbd524f3cb7bc3b189005cf4f66fa8
Author: fangyincheng <fa...@sina.com>
AuthorDate: Sat Oct 26 17:40:56 2019 +0800

    Fix: check service.Group and service.Interface
---
 request.go | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/request.go b/request.go
index 968372d..27437c6 100644
--- a/request.go
+++ b/request.go
@@ -236,10 +236,13 @@ func packRequest(service Service, header DubboHeader, req interface{}) ([]byte,
 	}
 
 	request.Attachments[PATH_KEY] = service.Path
-	request.Attachments[GROUP_KEY] = service.Group
-	request.Attachments[INTERFACE_KEY] = service.Interface
 	request.Attachments[VERSION_KEY] = service.Version
-
+	if len(service.Group) > 0 {
+		request.Attachments[GROUP_KEY] = service.Group
+	}
+	if len(service.Interface) > 0 {
+		request.Attachments[INTERFACE_KEY] = service.Interface
+	}
 	if service.Timeout != 0 {
 		request.Attachments[TIMEOUT_KEY] = strconv.Itoa(int(service.Timeout / time.Millisecond))
 	}