From 7b78f3e986fdbaceddec9fd2d431114504f6c4c7 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 4 Dec 2019 13:36:30 +0300 Subject: [PATCH] linting fixes, go.mod fixes Signed-off-by: Vasiliy Tolstov --- gossip.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gossip.go b/gossip.go index efc72fb..df11f4b 100644 --- a/gossip.go +++ b/gossip.go @@ -809,8 +809,8 @@ func (g *gossipRegistry) GetService(name string) ([]*registry.Service, error) { } func (g *gossipRegistry) ListServices() ([]*registry.Service, error) { - var services []*registry.Service g.RLock() + services := make([]*registry.Service, 0, len(g.services)) for _, service := range g.services { services = append(services, service...) }