From 49f8c5ec3a4cd1e76f0e03ee8119baf7acf9a24c Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Fri, 18 Jun 2021 01:19:07 +0800 Subject: [PATCH] fix --- registry/zookeeper/registry.go | 7 +------ registry/zookeeper/service_discovery.go | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/registry/zookeeper/registry.go b/registry/zookeeper/registry.go index f67f98465d..3b07648824 100644 --- a/registry/zookeeper/registry.go +++ b/registry/zookeeper/registry.go @@ -40,11 +40,6 @@ import ( "github.com/apache/dubbo-go/remoting/zookeeper" ) -const ( - // RegistryZkClient zk client name - RegistryZkClient = "zk registry" -) - func init() { extension.SetRegistry("zookeeper", newZkRegistry) } @@ -74,7 +69,7 @@ func newZkRegistry(url *common.URL) (registry.Registry, error) { } r.InitBaseRegistry(url, r) - err = zookeeper.ValidateZookeeperClient(r, RegistryZkClient) + err = zookeeper.ValidateZookeeperClient(r, url.Location) if err != nil { return nil, err } diff --git a/registry/zookeeper/service_discovery.go b/registry/zookeeper/service_discovery.go index 1b04322d71..6562628160 100644 --- a/registry/zookeeper/service_discovery.go +++ b/registry/zookeeper/service_discovery.go @@ -44,11 +44,6 @@ import ( "github.com/apache/dubbo-go/remoting/zookeeper/curator_discovery" ) -const ( - // RegistryZkClient zk client name - ServiceDiscoveryZkClient = "zk service discovery" -) - var ( // 16 would be enough. We won't use concurrentMap because in most cases, there are not race condition instanceMap = make(map[string]registry.ServiceDiscovery, 16) @@ -108,7 +103,7 @@ func newZookeeperServiceDiscovery(name string) (registry.ServiceDiscovery, error url: url, rootPath: rootPath, } - err := zookeeper.ValidateZookeeperClient(zksd, ServiceDiscoveryZkClient) + err := zookeeper.ValidateZookeeperClient(zksd, url.Location) if err != nil { return nil, err }