diff --git a/discovery/backends.go b/discovery/backends.go index 875a26c..f150115 100644 --- a/discovery/backends.go +++ b/discovery/backends.go @@ -12,12 +12,8 @@ import ( var ( // Backends is a global map of discovery backends indexed by their // associated scheme. - backends map[string]Backend -) - -func init() { backends = make(map[string]Backend) -} +) // Register makes a discovery backend available by the provided scheme. // If Register is called twice with the same scheme an error is returned. @@ -42,7 +38,7 @@ func parse(rawurl string) (string, string) { // ParseAdvertise parses the --cluster-advertise daemon config which accepts // : or : -func ParseAdvertise(store, advertise string) (string, error) { +func ParseAdvertise(advertise string) (string, error) { var ( iface *net.Interface addrs []net.Addr diff --git a/discovery/memory/memory.go b/discovery/memory/memory.go index f389825..777a9a1 100644 --- a/discovery/memory/memory.go +++ b/discovery/memory/memory.go @@ -25,6 +25,7 @@ func Init() { // Initialize sets the heartbeat for the memory backend. func (s *Discovery) Initialize(_ string, heartbeat time.Duration, _ time.Duration, _ map[string]string) error { s.heartbeat = heartbeat + s.values = make([]string, 0) return nil }