From 041ffffb159db29fff2ff73d9ab6356d53d77f54 Mon Sep 17 00:00:00 2001 From: kiripeng Date: Thu, 9 Dec 2021 23:29:47 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20map=20=E5=85=B6=E6=A1=B6=E4=B8=AD?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E5=AD=98=E5=82=A8=208=20=E4=B8=AA=E9=94=AE?= =?UTF-8?q?=E5=80=BC=E5=AF=B9=E5=85=83=E7=B4=A0,=E8=B6=85=E8=BF=87?= =?UTF-8?q?=E5=90=8E=E4=BC=9A=E5=82=A8=E5=AD=98=E5=88=B0=E6=BA=A2=E5=87=BA?= =?UTF-8?q?=E6=A1=B6=E6=88=96=E8=80=85=E6=89=A9=E5=AE=B9=EF=BC=8C=E5=BD=B1?= =?UTF-8?q?=E5=93=8D=E6=80=A7=E8=83=BD=EF=BC=8C=E9=A2=84=E5=85=88=E5=A3=B0?= =?UTF-8?q?=E6=98=8E=E5=AE=B9=E9=87=8F=E4=BB=A5=E5=85=8D=E5=BD=B1=E5=93=8D?= =?UTF-8?q?=E6=80=A7=E8=83=BD=20(#1671)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contrib/registry/nacos/registry.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/registry/nacos/registry.go b/contrib/registry/nacos/registry.go index 151d61ef3..e7854a09f 100644 --- a/contrib/registry/nacos/registry.go +++ b/contrib/registry/nacos/registry.go @@ -97,11 +97,11 @@ func (r *Registry) Register(ctx context.Context, si *registry.ServiceInstance) e return err } if si.Metadata == nil { - si.Metadata = make(map[string]string) + si.Metadata = make(map[string]string, 2) } si.Metadata["kind"] = u.Scheme si.Metadata["version"] = si.Version - rmd := make(map[string]string) + rmd := make(map[string]string, len(si.Metadata)) for k, v := range si.Metadata { rmd[k] = v }