From 12a0ae5602e892153ec97a3042b7bd4ca92a5d21 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Fri, 4 Oct 2024 18:35:07 +0800 Subject: [PATCH] fix: fix slice init length --- pkg/manifest1/balancer.go | 2 +- provider/aws/releases.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/manifest1/balancer.go b/pkg/manifest1/balancer.go index 3dbc1d9c06..35f941eb5f 100644 --- a/pkg/manifest1/balancer.go +++ b/pkg/manifest1/balancer.go @@ -102,7 +102,7 @@ func (mb ManifestBalancer) FirstPort() string { func (mb ManifestBalancer) Ports() []string { pp := mb.Entry.TCPPorts() - sp := make([]string, len(pp)) + sp := make([]string, 0, len(pp)) for _, p := range pp { sp = append(sp, strconv.Itoa(p.Balancer)) diff --git a/provider/aws/releases.go b/provider/aws/releases.go index b2c85bc102..55cb2ea131 100644 --- a/provider/aws/releases.go +++ b/provider/aws/releases.go @@ -872,7 +872,7 @@ func (p *Provider) resolveLinks(a *structs.App, m *manifest1.Manifest, r *struct } entry.Exports = make(map[string]string) - linkableEnvs := make([]string, len(entry.Environment)) + linkableEnvs := make([]string, 0, len(entry.Environment)) for _, env := range entry.Environment { linkableEnvs = append(linkableEnvs, fmt.Sprintf("%s=%s", env.Name, env.Value)) }