From da147b576328277bfb39c0937e25912ecfcfb512 Mon Sep 17 00:00:00 2001 From: Sasha Melentyev Date: Sun, 27 Feb 2022 07:29:12 +0300 Subject: [PATCH] feat: add zero prealloc (#1847) --- contrib/registry/consul/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/registry/consul/client.go b/contrib/registry/consul/client.go index 46321b8e2..6b661bd0b 100644 --- a/contrib/registry/consul/client.go +++ b/contrib/registry/consul/client.go @@ -51,7 +51,7 @@ func defaultResolver(_ context.Context, entries []*api.ServiceEntry) []*registry version = ss[1] } } - var endpoints []string //nolint:prealloc + endpoints := make([]string, 0) for scheme, addr := range entry.Service.TaggedAddresses { if scheme == "lan_ipv4" || scheme == "wan_ipv4" || scheme == "lan_ipv6" || scheme == "wan_ipv6" { continue