diff --git a/common/url_test.go b/common/url_test.go index ff5463275ebc9e7b79f979d7632c4cac225cdd39..21c1aeeb15fae9efdee1008acdd22578a70caa5c 100644 --- a/common/url_test.go +++ b/common/url_test.go @@ -16,12 +16,12 @@ package common import ( "context" - "github.com/dubbo/go-for-apache-dubbo/common/constant" "net/url" "testing" ) import ( + "github.com/dubbo/go-for-apache-dubbo/common/constant" "github.com/stretchr/testify/assert" ) diff --git a/common/utils/strings_test.go b/common/utils/strings_test.go index 37db5700446be999a147a259a25e7c16b4805cbb..73080ab9eef1016d88a7a49063d473aeee2e1ea1 100644 --- a/common/utils/strings_test.go +++ b/common/utils/strings_test.go @@ -1,9 +1,11 @@ package utils import ( - "github.com/stretchr/testify/assert" "testing" ) +import ( + "github.com/stretchr/testify/assert" +) func Test_RegSplit(t *testing.T) { strings := RegSplit("dubbo://123.1.2.1;jsonrpc://127.0.0.1;registry://3.2.1.3?registry=zookeeper", "\\s*[;]+\\s*") diff --git a/config/reference_config.go b/config/reference_config.go index 2124cd44e4caf7b585d084841235e6044899dd05..fb83b8001a3a1339b2c7a3c294f7519d0dfa6025 100644 --- a/config/reference_config.go +++ b/config/reference_config.go @@ -109,7 +109,7 @@ func (refconfig *ReferenceConfig) Refer() { refconfig.invoker = extension.GetProtocol(refconfig.urls[0].Protocol).Refer(*refconfig.urls[0]) } else { invokers := []protocol.Invoker{} - var regUrl *common.URL = nil + var regUrl *common.URL for _, u := range refconfig.urls { invokers = append(invokers, extension.GetProtocol(u.Protocol).Refer(*u)) if u.Protocol == constant.REGISTRY_PROTOCOL { diff --git a/config/testdata/consumer_config.yml b/config/testdata/consumer_config.yml index 8a9aeafac99da3a51a58a2dc7815b089987c867f..db242c95ad1f1eae32f2e84166263860c2030b48 100644 --- a/config/testdata/consumer_config.yml +++ b/config/testdata/consumer_config.yml @@ -38,6 +38,7 @@ references: filter: "" protocol : "dubbo" interface : "com.ikurento.user.UserProvider" + url: "dubbo://127.0.0.1:20000" cluster: "failover" methods : - name: "GetUser"