etcd-example
etcd-example copied to clipboard
the ETCD service discovery could not be run as readme described
In function (s *ServiceDiscovery) WatchService(prefix string) error
, the sentence
resp, err := s.cli.Get(context.Background(), prefix, clientv3.WithPrefix())
there is no any result return. And run the discovery.go and the register.go there is nothing to show in the terminal. Could you please test it, thanks!
@SmartsYoung Please make sure the ETCD is running.
Thanks, It's ok!
But in the discovery.go, the function (s *ServiceDiscovery) GetServices() []string
define the addrs := make([]string, 0, len(serverList))
may lead to fix as the serverList not a global var.
@SmartsYoung Yes, Thanks!