From 19293428b3ed1f9ddcd818e76faaec12a458cd47 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Sat, 8 Feb 2025 01:19:41 +0800 Subject: [PATCH] fix: fix slice init length (#3695) --- pki/util.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pki/util.go b/pki/util.go index b052ff80..9f093af4 100644 --- a/pki/util.go +++ b/pki/util.go @@ -506,8 +506,8 @@ func DeepEqualIPsAltNames(oldIPs, newIPs []net.IP) bool { if len(oldIPs) != len(newIPs) { return false } - oldIPsStrings := make([]string, len(oldIPs)) - newIPsStrings := make([]string, len(newIPs)) + oldIPsStrings := make([]string, 0, len(oldIPs)) + newIPsStrings := make([]string, 0, len(newIPs)) for i := range oldIPs { oldIPsStrings = append(oldIPsStrings, oldIPs[i].String()) newIPsStrings = append(newIPsStrings, newIPs[i].String())