bug: fix slice init length

Signed-off-by: yuhangcangqian <cuibuwei@qq.com>
This commit is contained in:
yuhangcangqian 2024-08-31 08:03:14 +08:00
parent b6f24d00a5
commit 0d5b29396a

4
tls.go
View file

@ -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