diff --git a/config/application_config.go b/config/application_config.go index 4f747fb16a63cc3880a40ac70b6fae7906d2f83f..c4c26bf8de4e564b687550806008da5756d4dd7b 100644 --- a/config/application_config.go +++ b/config/application_config.go @@ -19,6 +19,7 @@ package config import ( "github.com/apache/dubbo-go/common/constant" + "github.com/creasty/defaults" ) diff --git a/protocol/dubbo/dubbo_invoker.go b/protocol/dubbo/dubbo_invoker.go index b91b120233447c47e518859e4228229826f09681..9c7473f35f46121a5a9a963b9631556064870d9b 100644 --- a/protocol/dubbo/dubbo_invoker.go +++ b/protocol/dubbo/dubbo_invoker.go @@ -19,8 +19,6 @@ package dubbo import ( "context" - "github.com/apache/dubbo-go/config" - "github.com/apache/dubbo-go/remoting" "strconv" "strings" "sync" @@ -37,8 +35,10 @@ import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/logger" + "github.com/apache/dubbo-go/config" "github.com/apache/dubbo-go/protocol" invocation_impl "github.com/apache/dubbo-go/protocol/invocation" + "github.com/apache/dubbo-go/remoting" ) var ( @@ -51,7 +51,7 @@ var ( attachmentKey = []string{constant.INTERFACE_KEY, constant.GROUP_KEY, constant.TOKEN_KEY, constant.TIMEOUT_KEY} ) -// DubboInvoker. It is implement of protocol.Invoker. One dubboInvoker refer to one service and ip. +// DubboInvoker is implement of protocol.Invoker. A dubboInvoker refer to one service and ip. type DubboInvoker struct { protocol.BaseInvoker // the exchange layer, it is focus on network communication. diff --git a/protocol/dubbo/dubbo_invoker_test.go b/protocol/dubbo/dubbo_invoker_test.go index d363eb39a910725a5f917666a094ba299539bef7..6abd32d189d19dbfafe2d642dc0d88e20a809f9b 100644 --- a/protocol/dubbo/dubbo_invoker_test.go +++ b/protocol/dubbo/dubbo_invoker_test.go @@ -57,9 +57,6 @@ func TestDubboInvoker_Invoke(t *testing.T) { res := invoker.Invoke(context.Background(), inv) assert.NoError(t, res.Error()) assert.Equal(t, User{Id: "1", Name: "username"}, *res.Result().(*User)) - //result will not contain attachment - // attachment in result it is useless. - //assert.Equal(t, "test_value", res.Attachments()["test_key"]) // test attachments for request/response // CallOneway inv.SetAttachments(constant.ASYNC_KEY, "true")