diff --git a/config_center/zookeeper/impl.go b/config_center/zookeeper/impl.go index 8333088a21ba6374ee7230d0d1bcf2b40f5838c8..7a22f7817704b9e01626039948ffc9a830628801 100644 --- a/config_center/zookeeper/impl.go +++ b/config_center/zookeeper/impl.go @@ -20,16 +20,20 @@ package zookeeper import ( "strings" "sync" +) - gxset "github.com/dubbogo/gost/container/set" +import ( + perrors "github.com/pkg/errors" +) +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_center" "github.com/apache/dubbo-go/config_center/parser" "github.com/apache/dubbo-go/remoting/zookeeper" - perrors "github.com/pkg/errors" + gxset "github.com/dubbogo/gost/container/set" ) const ( diff --git a/registry/kubernetes/registry.go b/registry/kubernetes/registry.go index 115f2112173f0d9bdda30c5c122045ea0538c15f..a26478f2ee5e82cc7cbeaf7996a0febb49238e91 100644 --- a/registry/kubernetes/registry.go +++ b/registry/kubernetes/registry.go @@ -22,18 +22,21 @@ import ( "path" "sync" "time" +) +import ( getty "github.com/apache/dubbo-getty" - perrors "github.com/pkg/errors" + v1 "k8s.io/api/core/v1" +) +import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/registry" "github.com/apache/dubbo-go/remoting/kubernetes" - v1 "k8s.io/api/core/v1" ) const ( diff --git a/registry/zookeeper/listener.go b/registry/zookeeper/listener.go index 53084c15ddc7e2d52cbea919386709da3c3067e0..453cb574187fd2095b121971240446eb6d27b208 100644 --- a/registry/zookeeper/listener.go +++ b/registry/zookeeper/listener.go @@ -20,14 +20,18 @@ package zookeeper import ( "strings" "sync" +) + +import ( + perrors "github.com/pkg/errors" +) +import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/config_center" "github.com/apache/dubbo-go/registry" "github.com/apache/dubbo-go/remoting" - perrors "github.com/pkg/errors" - zk "github.com/apache/dubbo-go/remoting/zookeeper" ) diff --git a/registry/zookeeper/registry.go b/registry/zookeeper/registry.go index 838164607cd4d304fc60f1ed42f47af9c0ea3bb9..bce8eb531ca49e805a543a438484217a5f4338ce 100644 --- a/registry/zookeeper/registry.go +++ b/registry/zookeeper/registry.go @@ -23,16 +23,20 @@ import ( "path" "sync" "time" +) +import ( "github.com/dubbogo/go-zookeeper/zk" + perrors "github.com/pkg/errors" +) +import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/extension" "github.com/apache/dubbo-go/common/logger" "github.com/apache/dubbo-go/registry" "github.com/apache/dubbo-go/remoting/zookeeper" - perrors "github.com/pkg/errors" ) const ( diff --git a/registry/zookeeper/service_discovery.go b/registry/zookeeper/service_discovery.go index 004fa9733c568de5f8e8df26cead16d688260f06..6ac10f9b1612955e9054b97b60daaef4eaeefa6c 100644 --- a/registry/zookeeper/service_discovery.go +++ b/registry/zookeeper/service_discovery.go @@ -23,11 +23,14 @@ import ( "strconv" "strings" "sync" - +) +import ( gxset "github.com/dubbogo/gost/container/set" - gxpage "github.com/dubbogo/gost/hash/page" + perrors "github.com/pkg/errors" +) +import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/extension" @@ -37,7 +40,6 @@ import ( "github.com/apache/dubbo-go/remoting" "github.com/apache/dubbo-go/remoting/zookeeper" "github.com/apache/dubbo-go/remoting/zookeeper/curator_discovery" - perrors "github.com/pkg/errors" ) const ( diff --git a/remoting/zookeeper/client.go b/remoting/zookeeper/client.go index ba67d850991592f2658bcc8bc5a1a239f28bf43b..4df4a2b20cd71f5b859c77b5ee01303b41db0718 100644 --- a/remoting/zookeeper/client.go +++ b/remoting/zookeeper/client.go @@ -23,12 +23,16 @@ import ( "sync" "sync/atomic" "time" +) +import ( "github.com/dubbogo/go-zookeeper/zk" + perrors "github.com/pkg/errors" +) +import ( "github.com/apache/dubbo-go/common/constant" "github.com/apache/dubbo-go/common/logger" - perrors "github.com/pkg/errors" ) const ( @@ -232,7 +236,7 @@ func NewMockZookeeperClient(name string, timeout time.Duration, opts ...Option) if err != nil { return nil, nil, nil, perrors.WithMessagef(err, "zk.Connect") } - + atomic.StoreUint32(&z.valid, 1) return ts, z, event, nil } diff --git a/remoting/zookeeper/client_test.go b/remoting/zookeeper/client_test.go index a5aa98c22fc09fe6b7ecdffba8d55639a06e5bc6..4cff1340ec16aeb0bcd96434d6208d2c70e1970b 100644 --- a/remoting/zookeeper/client_test.go +++ b/remoting/zookeeper/client_test.go @@ -20,12 +20,17 @@ package zookeeper import ( "testing" "time" +) - "github.com/apache/dubbo-go/common/logger" +import ( "github.com/dubbogo/go-zookeeper/zk" "github.com/stretchr/testify/assert" ) +import ( + "github.com/apache/dubbo-go/common/logger" +) + func verifyEventStateOrder(t *testing.T, c <-chan zk.Event, expectedStates []zk.State, source string) { for _, state := range expectedStates { for { diff --git a/remoting/zookeeper/facade.go b/remoting/zookeeper/facade.go index 92c3ea7230ee966573257e4885263c7ecc86a2a3..4aa327fb0dc99d75e30e75a7bbb7b3e7fbf0841b 100644 --- a/remoting/zookeeper/facade.go +++ b/remoting/zookeeper/facade.go @@ -20,7 +20,9 @@ package zookeeper import ( "sync" "time" +) +import ( "github.com/apache/dubbo-go/common" "github.com/apache/dubbo-go/common/logger" ) diff --git a/remoting/zookeeper/facade_test.go b/remoting/zookeeper/facade_test.go index 5e9382ace6a797776a732f9d1c3c0ed7a0fb36a1..dd01fc21a2617f1e5a1bd5f5479ff5d179889534 100644 --- a/remoting/zookeeper/facade_test.go +++ b/remoting/zookeeper/facade_test.go @@ -21,12 +21,17 @@ import ( "sync" "testing" "time" +) - "github.com/apache/dubbo-go/common" +import ( "github.com/dubbogo/go-zookeeper/zk" "github.com/stretchr/testify/assert" ) +import ( + "github.com/apache/dubbo-go/common" +) + type mockFacade struct { client *ZookeeperClient cltLock sync.Mutex diff --git a/remoting/zookeeper/listener.go b/remoting/zookeeper/listener.go index b34a16c3a22cc2f2c4d48c3edfdce55da888c9e0..d752cdafc4f7e250e2ba5f5c6209f83348100906 100644 --- a/remoting/zookeeper/listener.go +++ b/remoting/zookeeper/listener.go @@ -22,15 +22,19 @@ import ( "strings" "sync" "time" +) +import ( getty "github.com/apache/dubbo-getty" "github.com/dubbogo/go-zookeeper/zk" + perrors "github.com/pkg/errors" +) +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/remoting" - perrors "github.com/pkg/errors" ) var ( diff --git a/remoting/zookeeper/listener_test.go b/remoting/zookeeper/listener_test.go index 760fe8f1767eceb14beec2d948d80157e893b504..f56bd95c9f33b4aa27c836a0a45ca9fbb4ce114e 100644 --- a/remoting/zookeeper/listener_test.go +++ b/remoting/zookeeper/listener_test.go @@ -22,13 +22,18 @@ import ( "sync" "testing" "time" +) - "github.com/apache/dubbo-go/common/logger" - "github.com/apache/dubbo-go/remoting" +import ( "github.com/dubbogo/go-zookeeper/zk" "github.com/stretchr/testify/assert" ) +import ( + "github.com/apache/dubbo-go/common/logger" + "github.com/apache/dubbo-go/remoting" +) + var ( dubboPropertiesPath = "/dubbo/dubbo.properties" )