Repository: go-kit/kit
Pull request #1120 (2021-06-22 07:12:00)

Replace unmaintained zk library with drop-in replacement
Related #1109


Patch:
diff --git a/go.mod b/go.mod
index 92a66a7..edfea9c 100644
--- a/go.mod
+++ b/go.mod
@@ -21,6 +21,7 @@ require (
 	github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8 // indirect
 	github.com/go-logfmt/logfmt v0.5.0
 	github.com/go-stack/stack v1.8.0
+	github.com/go-zookeeper/zk v1.0.2
 	github.com/google/btree v1.0.0 // indirect
 	github.com/hashicorp/consul/api v1.3.0
 	github.com/hashicorp/golang-lru v0.5.1 // indirect
@@ -34,7 +35,6 @@ require (
 	github.com/performancecopilot/speed v3.0.0+incompatible
 	github.com/pkg/errors v0.9.1
 	github.com/prometheus/client_golang v1.11.0
-	github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da
 	github.com/sirupsen/logrus v1.6.0
 	github.com/smartystreets/goconvey v1.6.4 // indirect
 	github.com/sony/gobreaker v0.4.1
diff --git a/go.sum b/go.sum
index 2cd8127..10d8626 100644
--- a/go.sum
+++ b/go.sum
@@ -89,6 +89,8 @@ github.com/go-logfmt/logfmt v0.5.0 h1:TrB8swr/68K7m9CcGut2g3UOihhbcbiMAYiuTXdEih
 github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
 github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/go-zookeeper/zk v1.0.2 h1:4mx0EYENAdX/B/rbunjlt5+4RTA/a9SMHBRuSKdGxPM=
+github.com/go-zookeeper/zk v1.0.2/go.mod h1:nOB03cncLtlp4t+UAkGSV+9beXP/akpekBwL+UX1Qcw=
 github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
 github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
 github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
@@ -287,8 +289,6 @@ github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqn
 github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
-github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da h1:p3Vo3i64TCLY7gIfzeQaUJ+kppEO5WQG3cL8iE8tGHU=
-github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
 github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
 github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
 github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
diff --git a/sd/zk/client.go b/sd/zk/client.go
index 60ac138..b88ad14 100644
--- a/sd/zk/client.go
+++ b/sd/zk/client.go
@@ -6,7 +6,7 @@ import (
 	"strings"
 	"time"
 
-	"github.com/samuel/go-zookeeper/zk"
+	"github.com/go-zookeeper/zk"
 
 	"github.com/go-kit/kit/log"
 )
diff --git a/sd/zk/instancer.go b/sd/zk/instancer.go
index 6319998..de50eae 100644
--- a/sd/zk/instancer.go
+++ b/sd/zk/instancer.go
@@ -1,7 +1,7 @@
 package zk
 
 import (
-	"github.com/samuel/go-zookeeper/zk"
+	"github.com/go-zookeeper/zk"
 
 	"github.com/go-kit/kit/log"
 	"github.com/go-kit/kit/sd"
diff --git a/sd/zk/logwrapper.go b/sd/zk/logwrapper.go
index abb7b6d..ab7d309 100644
--- a/sd/zk/logwrapper.go
+++ b/sd/zk/logwrapper.go
@@ -3,7 +3,7 @@ package zk
 import (
 	"fmt"
 
-	"github.com/samuel/go-zookeeper/zk"
+	"github.com/go-zookeeper/zk"
 
 	"github.com/go-kit/kit/log"
 )


Test patch:
diff --git a/sd/zk/client_test.go b/sd/zk/client_test.go
index e201536..05ede2e 100644
--- a/sd/zk/client_test.go
+++ b/sd/zk/client_test.go
@@ -5,7 +5,7 @@ import (
 	"testing"
 	"time"
 
-	stdzk "github.com/samuel/go-zookeeper/zk"
+	stdzk "github.com/go-zookeeper/zk"
 
 	"github.com/go-kit/kit/log"
 )
diff --git a/sd/zk/integration_test.go b/sd/zk/integration_test.go
index 6a9a7ca..c1022a5 100644
--- a/sd/zk/integration_test.go
+++ b/sd/zk/integration_test.go
@@ -8,7 +8,7 @@ import (
 	"testing"
 	"time"
 
-	stdzk "github.com/samuel/go-zookeeper/zk"
+	stdzk "github.com/go-zookeeper/zk"
 )
 
 var (
diff --git a/sd/zk/util_test.go b/sd/zk/util_test.go
index 4f975a5..a041cc9 100644
--- a/sd/zk/util_test.go
+++ b/sd/zk/util_test.go
@@ -8,7 +8,7 @@ import (
 	"sync"
 	"time"
 
-	"github.com/samuel/go-zookeeper/zk"
+	"github.com/go-zookeeper/zk"
 
 	"github.com/go-kit/kit/endpoint"
 	"github.com/go-kit/kit/log"