From 0d5b29396ac295d5375f5dae68bd82ef6c0480f9 Mon Sep 17 00:00:00 2001 From: yuhangcangqian Date: Sat, 31 Aug 2024 08:03:14 +0800 Subject: [PATCH] bug: fix slice init length Signed-off-by: yuhangcangqian --- tls.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tls.go b/tls.go index 526fd36..7870b54 100644 --- a/tls.go +++ b/tls.go @@ -53,7 +53,7 @@ func getTLSCipherSuites(v string) []uint16 { supported := tls.CipherSuites() if v == "" { - suites := make([]uint16, len(supported)) + suites := make([]uint16, 0, len(supported)) for _, cs := range supported { suites = append(suites, cs.ID) @@ -64,7 +64,7 @@ func getTLSCipherSuites(v string) []uint16 { var found bool txts := strings.Split(v, ",") - suites := make([]uint16, len(txts)) + suites := make([]uint16, 0, len(txts)) for _, want := range txts { found = false