From f89a70d845a239587751324569064af6d6ed464d Mon Sep 17 00:00:00 2001 From: cui fliter Date: Fri, 4 Oct 2024 19:09:21 +0800 Subject: [PATCH] fix: fix slice init length --- internal/runtime/storage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/runtime/storage.go b/internal/runtime/storage.go index c5aa2db6..fab66b9a 100644 --- a/internal/runtime/storage.go +++ b/internal/runtime/storage.go @@ -201,7 +201,7 @@ func (s *StorageManager) ListNamespaces(ctx context.Context) ([]string, error) { return nil, err } - res := make([]string, len(nsList.Items)) + res := make([]string, 0, len(nsList.Items)) for _, ns := range nsList.Items { res = append(res, ns.Name) }