diff --git a/protocol/dubbo/client_test.go b/protocol/dubbo/client_test.go index ed986cf87cf3a10f77f3038de0e4ef238bfa25b7..eb1f15c862a910120e118c06bf9b572e93f58832 100644 --- a/protocol/dubbo/client_test.go +++ b/protocol/dubbo/client_test.go @@ -145,7 +145,7 @@ func TestClient_AsyncCall(t *testing.T) { lock := sync.Mutex{} lock.Lock() err := c.AsyncCall(NewRequest("127.0.0.1:20000", url, "GetUser", []interface{}{"1", "username"}, nil), func(response CallResponse) { - assert.Equal(t, User{Id: "1", Name: "username"}, *response.Reply.(*User)) + assert.Equal(t, User{Id: "1", Name: "username"}, *response.Reply.(*Response).reply.(*User)) lock.Unlock() }, NewResponse(user, nil)) assert.NoError(t, err) diff --git a/protocol/dubbo/codec.go b/protocol/dubbo/codec.go index 5e8ad23a613d6215843f07c5c0731921f92b093d..a878ffd91e29d6949870ec25fed9481f301b435a 100644 --- a/protocol/dubbo/codec.go +++ b/protocol/dubbo/codec.go @@ -116,8 +116,9 @@ type PendingResponse struct { func NewPendingResponse() *PendingResponse { return &PendingResponse{ - start: time.Now(), - done: make(chan struct{}), + start: time.Now(), + response: &Response{}, + done: make(chan struct{}), } } diff --git a/protocol/dubbo/dubbo_protocol.go b/protocol/dubbo/dubbo_protocol.go index 4438a0b3d0e32127536b818806d190a2d2a5a2ba..59d1ea05160696754b46dfead5713684aa7a94f7 100644 --- a/protocol/dubbo/dubbo_protocol.go +++ b/protocol/dubbo/dubbo_protocol.go @@ -17,13 +17,16 @@ package dubbo +import ( + "sync" +) + import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/config" "github.com/apache/dubbo-go/protocol" - "sync" ) const ( diff --git a/protocol/dubbo/dubbo_protocol_test.go b/protocol/dubbo/dubbo_protocol_test.go index 26ce4a1906d5d6fe425f23984586914c293f47a4..a6b0bc1df3cf2eb46e07c9dab149d04f62f78012 100644 --- a/protocol/dubbo/dubbo_protocol_test.go +++ b/protocol/dubbo/dubbo_protocol_test.go @@ -19,7 +19,6 @@ package dubbo import ( "context" - "github.com/apache/dubbo-go/common/constant" "testing" ) @@ -29,6 +28,7 @@ import ( import ( "github.com/apache/dubbo-go/common" + "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/protocol" ) diff --git a/protocol/protocolwrapper/protocol_filter_wrapper_test.go b/protocol/protocolwrapper/protocol_filter_wrapper_test.go index 98bd206325ffd38a325b667f7f0bc2684bbf626f..dc376313549c24da1cc6cb64a42e8445ef4fe346 100644 --- a/protocol/protocolwrapper/protocol_filter_wrapper_test.go +++ b/protocol/protocolwrapper/protocol_filter_wrapper_test.go @@ -32,7 +32,6 @@ import ( "github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/filter" - //"github.com/apache/dubbo-go/filter/impl" "github.com/apache/dubbo-go/protocol" )